48 }
typedef SProtoNxscopeIOBind;
53 }
typedef SProtoNxscopeNames;
57 SProtoNxscopeIOBind bind;
58 SProtoNxscopeNames name;
59 }
typedef SProtoNxscopeIOBind2;
65#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD
66 , threadSampleMember()
75#ifdef CONFIG_DAWN_IO_NOTIFY
76 sem_init(&streamSem, 0, 0);
92 int allocObject(SProtoNxscopeIOBind *alloc);
93 int allocNames(
size_t j, SProtoNxscopeNames *names);
94 int configureNxscope();
96 virtual int initPriv() = 0;
97 virtual int deinitPriv() = 0;
98 virtual int startPriv() = 0;
99 virtual int stopPriv() = 0;
102#ifdef CONFIG_DAWN_IO_NOTIFY
103 typedef int (*nxscope_put_cb_t)(
struct nxscope_s *nxs,
109#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD
110 struct proto_nxscope_iochan_s;
112 typedef int (*nxscope_sample_cb_t)(
CProtoNxscope *obj,
struct proto_nxscope_iochan_s *iochan);
115 struct proto_nxscope_iochan_s
125#ifdef CONFIG_DAWN_IO_NOTIFY
126 nxscope_put_cb_t put;
129#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD
130 nxscope_sample_cb_t sample;
133 }
typedef SProtoNxscopeIochan;
137 NXSCOPE_USER_SET_IO = NXSCOPE_HDRID_USER,
138 NXSCOPE_USER_SET_IO_SEEK = NXSCOPE_HDRID_USER + 1,
139 NXSCOPE_USER_GET_IO = NXSCOPE_HDRID_USER + 2,
140 NXSCOPE_USER_GET_IO_SEEK = NXSCOPE_HDRID_USER + 3
143 CThreadedObject threadRecvMember;
145#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD
146 CThreadedObject threadSampleMember;
149 struct nxscope_s nxs;
150 struct nxscope_cfg_s nxsCfg;
151 struct nxscope_proto_s nxsProto;
152 struct nxscope_callbacks_s nxsCbs;
158 std::recursive_mutex streamLock;
160#ifdef CONFIG_DAWN_IO_NOTIFY
171 std::vector<const SProtoNxscopeIOBind *> vchannels;
172 std::vector<const SProtoNxscopeNames *> vnames;
173 std::vector<SProtoNxscopeIochan> vio;
174 bool hasStreamChannels =
false;
178 int handleUserCommand(uint8_t
id, uint8_t *buff);
179 int userSetIO(uint8_t *buff);
180 int userSetIOSeek(uint8_t *buff);
181 int userGetIO(uint8_t *buff);
182 int userGetIOSeek(uint8_t *buff);
183 int sendAck(
int ret);
186 static int userIdCb(
void *priv, uint8_t
id, uint8_t *buff);
188#ifdef CONFIG_DAWN_IO_NOTIFY
189 static int ioNotifierCb(
void *priv, io_ddata_t *data);
192 uint8_t getChannelDim(
const CIOCommon &io);
193 uint8_t getChannelDtype(
const CIOCommon &io);
194 int nxscopeChannelsCreate();
195 int bindChannelCallbacks(SProtoNxscopeIochan &iochan, uint8_t dtype);
199 using nxscope_put_t = int (*)(
struct nxscope_s *, uint8_t, T *, uint8_t);
201 template<
typename T, nxscope_put_t<T> Put>
202 void bindTyped(SProtoNxscopeIochan &iochan);
204#ifdef CONFIG_DAWN_IO_NOTIFY
205 template<
typename T, nxscope_put_t<T> Put>
206 static int putBatch(
struct nxscope_s *nxs, uint8_t chan, io_ddata_t *data, uint8_t dim);
209#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD
210 void getAndPut(SProtoNxscopeIochan *iochan);
212 template<
typename T, nxscope_put_t<T> Put>
213 static int sampleTyped(CProtoNxscope *obj, SProtoNxscopeIochan *iochan);
218#ifdef CONFIG_DAWN_PROTO_NXSCOPE_SAMPLE_THREAD