Go to the documentation of this file.
68 using namespace xsens;
106 m_handlerList = NULL;
107 m_managerList = NULL;
116 clearChainedManagers();
117 clearCallbackHandlers(
false);
118 delete m_callbackMutex;
139 m_handlerList = NULL;
147 currentMgr = currentMgr->
m_next;
171 current = current->
m_next;
180 m_handlerList = current;
191 current = current->
m_next;
220 current = current->
m_next;
233 m_handlerList = current->
m_next;
239 current = current->
m_next;
255 m_managerList = NULL;
264 if (!cm || cm ==
this)
274 m_managerList = current;
285 current = current->
m_next;
314 m_managerList = current->
m_next;
320 current = current->
m_next;
344 addCallbackHandler(current->
m_handler, chain);
345 current = current->
m_next;
358 current = current->
m_next;
371 current = current->
m_next;
384 current = current->
m_next;
397 current = current->
m_next;
410 current = current->
m_next;
423 current = current->
m_next;
436 current = current->
m_next;
450 current = current->
m_next;
464 current = current->
m_next;
477 current = current->
m_next;
490 current = current->
m_next;
503 current = current->
m_next;
516 current = current->
m_next;
529 current = current->
m_next;
542 current = current->
m_next;
555 current = current->
m_next;
568 current = current->
m_next;
581 current = current->
m_next;
594 current = current->
m_next;
607 current = current->
m_next;
620 current = current->
m_next;
632 current = current->
m_next;
645 current = current->
m_next;
void(* m_onProgressUpdated)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, int current, int total, const struct XsString *identifier)
Called when a long-duration operation has made some progress or has completed. Examples include loadL...
void addChainedManager(CallbackManagerXda *cm)
Add a chained manager to the list.
~CallbackManagerXda()
Destructor, clears the callback list.
void copyCallbackHandlersTo(CallbackManagerXda *cm, bool chain=true)
Copy all handlers from this manager into cm.
void onInfoResponse(XsDevice *dev, XsInfoRequest request) override
The XsCallback::onInfoResponse() callback forwarding function.
A readers-writer mutex class.
A list of XsDataPacketPtr values.
void onAllRecordedDataAvailable(XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override
The XsCallback::onAllRecordedDataAvailable() callback forwarding function.
void(* m_onError)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, XsResultValue error)
Called when an error has occurred while handling incoming data.
void removeChainedManager(CallbackManagerXda *cm)
Remove achained manager from the list.
int onWriteMessageToLogFile(XsDevice *dev, const XsMessage *message) override
The XsCallback::onWriteMessageToLogFile() callback forwarding function.
void onBufferedDataAvailable(XsDevice *dev, const XsDataPacket *data) override
The XsCallback::onBufferedDataAvailable() callback forwarding function.
A list of uint8_t values.
Structure that contains callback functions for the Xsens Device API.
void(* m_onDataUnavailable)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, int64_t packetId)
Called when XDA detects that data is forever unavailable.
void onRecordedDataAvailable(XsDevice *dev, const XsDataPacket *data) override
The XsCallback::onRecordedDataAvailable() callback forwarding function.
CallbackManagerXda * m_manager
The callback managger.
void(* m_onLiveDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, const struct XsDataPacket *packet)
Called when new data has been received from a device or read from a file. When processing on PC is en...
void(* m_onMessageSentToDevice)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, struct XsMessage const *message)
Called just after a message is sent to the device.
CallbackHandlerXdaItem * m_next
The next item in the list or NULL if this is the last item.
CallbackHandlerXdaItem * m_handlerList
The first item in the linked list of callback handlers.
XsCallbackPlainC * m_handler
The callback handler.
Contains an interpreted data message. The class provides easy access to the contained data through it...
void onAllDataAvailable(XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override
The XsCallback::onAllDataAvailable() callback forwarding function.
A readers-writer lock class.
CallbackManagerXda()
Constructor, initializes the callback list.
void(* m_onWakeupReceived)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev)
Called when a wakeup message has been received from a device. This indicates that the device has just...
void(* m_onMessageDetected)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, XsProtocolType type, struct XsByteArray const *rawMessage)
Called just after a message is detected in raw data from the device.
void(* m_onAllDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevicePtrArray *devs, const struct XsDataPacketPtrArray *packets)
Called when new data has been received for devices connected to the same main device....
void removeCallbackHandler(XsCallbackPlainC *cb, bool chain=true)
Remove a handler from the list.
void(* m_onDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, const struct XsDataPacket *packet)
Called when new data has been received from a device or read from a file. When processing on PC is en...
void onLiveDataAvailable(XsDevice *dev, const XsDataPacket *packet) override
The XsCallback::onLiveDataAvailable() callback forwarding function.
int(* m_onWriteMessageToLogFile)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, const struct XsMessage *message)
Called when XDA has a message that could be written to a log file.
XsResultValue
Xsens result values.
void onDataUnavailable(XsDevice *dev, int64_t packetId) override
The XsCallback::onDataUnavailable() callback forwarding function.
void(* m_onMissedPackets)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, int count, int first, int last)
Called when XDA detects that packets have been missed.
void clearChainedManagers()
Clear the chained manager list.
void copyCallbackHandlersFrom(CallbackManagerXda *cm, bool chain=true)
Copy all handlers from cm into this manager.
void onWakeupReceived(XsDevice *dev) override
The XsCallback::onWakeupReceived() callback forwarding function.
void(* m_onDeviceStateChanged)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, XsDeviceState newState, XsDeviceState oldState)
Called when a device's state has changed (ie config mode, measurement mode, recording mode)
void(* m_onBufferedDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, const struct XsDataPacket *packet)
Called when XDA has a data packet that could be written to a log file.
void onAllLiveDataAvailable(XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override
The XsCallback::onAllLiveDataAvailable() callback forwarding function.
void onNonDataMessage(XsDevice *dev, XsMessage const *message) override
The Xscallback::onNonDataMessage() callback forwarding function.
void onMessageSentToDevice(XsDevice *dev, XsMessage const *message) override
The Xscallback::onMessageSentToDevice() callback forwarding function.
void onConnectivityChanged(XsDevice *dev, XsConnectivityState newState) override
The XsCallback::onConnectivityChanged() callback forwarding function.
void(* m_onRestoreCommunication)(struct XsCallbackPlainC *thisPtr, const struct XsString *portName, XsResultValue result)
Called when restore communication is completed, stopped or an error occurred.
void(* m_onConnectivityChanged)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, XsConnectivityState newState)
Called when XDA has detected a change in the connectivity state of a device.
void onMessageReceivedFromDevice(XsDevice *dev, XsMessage const *message) override
The Xscallback::onMessageReceivedFromDevice() callback forwarding function.
xsens::MutexReadWrite * m_callbackMutex
Administration mutex.
void onDeviceStateChanged(XsDevice *dev, XsDeviceState newState, XsDeviceState oldState) override
The XsCallback::onDeviceStateChanged() callback forwarding function.
void onRestoreCommunication(const XsString *portName, XsResultValue result) override
The Xscallback::onRestoreCommunication callback forwarding function.
XsInfoRequest
Information request identifiers.
void(* m_onMessageReceivedFromDevice)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, struct XsMessage const *message)
Called just after a valid message (after parsing) is received from the device.
Structure for storing a single message.
void(* m_onAllLiveDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevicePtrArray *devs, const struct XsDataPacketPtrArray *packets)
Called when new data has been received for devices connected to the same main device....
A list of XsDevicePtr values.
void(* m_onRecordedDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, const struct XsDataPacket *packet)
Called when new data has been received from a device in a recording state or read from a file....
void(* m_onAllRecordedDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevicePtrArray *devs, const struct XsDataPacketPtrArray *packets)
Called when new data has been received for devices connected to the same main device in a recording s...
void(* m_onNonDataMessage)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, struct XsMessage const *message)
Called when a non data, non reply message has been received.
void onTransmissionRequest(int channelId, const XsByteArray *data) override
void onMissedPackets(XsDevice *dev, int count, int first, int last) override
The XsCallback::onMissedPackets() callback forwarding function.
XsConnectivityState
XsDevice connectivity state identifiers.
void onDataAvailable(XsDevice *dev, const XsDataPacket *data) override
The XsCallback::onDataAvailable() callback forwarding function.
void onAllBufferedDataAvailable(XsDevicePtrArray *devs, const XsDataPacketPtrArray *packets) override
The XsCallback::onAllBufferedDataAvailable() callback forwarding function.
void onMessageDetected(XsDevice *dev, XsProtocolType type, XsByteArray const *rawMessage) override
The Xscallback::onMessageReceivedFromDevice() callback forwarding function.
void onProgressUpdated(XsDevice *dev, int current, int total, const XsString *identifier) override
The XsCallback::onProgressUpdated() callback forwarding function.
XsProtocolType
Protocol types (XsDevice::enableProtocol())
XsDeviceState
XsDevice state identifiers.
void(* m_onAllBufferedDataAvailable)(struct XsCallbackPlainC *thisPtr, struct XsDevicePtrArray *devs, const struct XsDataPacketPtrArray *packets)
Called when new data has been received for devices connected to the same main device....
void onError(XsDevice *dev, XsResultValue error) override
The Xscallback::onError() callback forwarding function.
Linked list item that contains a registered XsCallback handler for CallbackManagerXda.
Class that delegates callbacks to registered XsCallbackHandlerItems.
void(* m_onInfoResponse)(struct XsCallbackPlainC *thisPtr, struct XsDevice *dev, XsInfoRequest request)
Called when an information request has resulted in a response.
A 0-terminated managed string of characters.
CallbackManagerItem * m_next
The next item in the list or NULL if this is the last item.
void clearCallbackHandlers(bool chain=true)
Clear the callback list.
Linked list item that contains a chained CallbackManagerXda.
void addCallbackHandler(XsCallbackPlainC *cb, bool chain=true)
Add a handler to the list.
void(* m_onTransmissionRequest)(struct XsCallbackPlainC *thisPtr, int channelId, const struct XsByteArray *data)
Called when XDA needs to send raw data to a device connected using a custom communication channel.