kopia lustrzana https://github.com/cyoung/stratux
inline static cgo workaround, callback function name changes
rodzic
dd52591b1f
commit
bb39c687c5
|
@ -16,9 +16,9 @@ package dump978
|
|||
#include <stdint.h>
|
||||
#include "dump978/dump978.h"
|
||||
|
||||
extern void goCallback(char updown, uint8_t *data, int len);
|
||||
CallBack get_go_cb() {
|
||||
return (CallBack)goCallback;
|
||||
extern void dump978Cb(char updown, uint8_t *data, int len);
|
||||
static inline CallBack GetGoCb() {
|
||||
return (CallBack)dump978Cb;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
@ -31,7 +31,7 @@ type UserCbT func(C.char, *C.uint8_t, C.int)
|
|||
|
||||
// Dump978Init must be the first function called in this package.
|
||||
func Dump978Init() {
|
||||
C.Dump978Init((C.CallBack)(C.get_go_cb()))
|
||||
C.Dump978Init((C.CallBack)(C.GetGoCb()))
|
||||
}
|
||||
|
||||
// ProcessData passes buf (modulated data) to dump978 for demodulation.
|
||||
|
|
|
@ -20,8 +20,8 @@ import "C"
|
|||
// outChan is a buffered output channel for demodulated data.
|
||||
var OutChan = make(chan []byte, 100)
|
||||
|
||||
//export goCallback
|
||||
func goCallback(updown C.char, data *C.uint8_t, length C.int) {
|
||||
//export dump978Cb
|
||||
func dump978Cb(updown C.char, data *C.uint8_t, length C.int) {
|
||||
outData := make([]byte, length+1)
|
||||
// c buffer to go slice without copying
|
||||
var buf []byte
|
||||
|
|
Ładowanie…
Reference in New Issue