From 177b572c875a4c4888a88e9b487c91ebb8cd3a41 Mon Sep 17 00:00:00 2001 From: pvanhorn Date: Fri, 10 Feb 2017 09:16:09 -0800 Subject: [PATCH] move types to openthread-types.h (#1299) --- include/openthread-types.h | 55 ++++++++++++++++++++++++++++++++++++++ include/openthread.h | 51 ----------------------------------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/include/openthread-types.h b/include/openthread-types.h index db2050adf..ab354b506 100644 --- a/include/openthread-types.h +++ b/include/openthread-types.h @@ -1036,6 +1036,61 @@ typedef struct otUdpSocket struct otUdpSocket *mNext; ///< A pointer to the next UDP socket (internal use only). } otUdpSocket; +#ifdef OTDLL + +/** + * This function pointer is called to notify addition and removal of OpenThread devices. + * + * @param[in] aAdded A flag indicating if the device was added or removed. + * @param[in] aDeviceGuid A GUID indicating which device state changed. + * @param[in] aContext A pointer to application-specific context. + * + */ +typedef void (OTCALL *otDeviceAvailabilityChangedCallback)(bool aAdded, const GUID *aDeviceGuid, void *aContext); + +#endif // OTDLL + +/** + * This function pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or + * the scan completes. + * + * @param[in] aResult A valid pointer to the beacon information or NULL when the active scan completes. + * @param[in] aContext A pointer to application-specific context. + * + */ +typedef void (OTCALL *otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext); + +/** + * This function pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the + * scan completes. + * + * @param[in] aResult A valid pointer to the energy scan result information or NULL when the energy scan completes. + * @param[in] aContext A pointer to application-specific context. + * + */ +typedef void (OTCALL *otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext); + +/** + * This function pointer is called to notify certain configuration or state changes within OpenThread. + * + * @param[in] aFlags A bit-field indicating specific state that has changed. + * @param[in] aContext A pointer to application-specific context. + * + */ +typedef void (OTCALL *otStateChangedCallback)(uint32_t aFlags, void *aContext); + +/** + * This function pointer is called when Network Diagnostic Get response is received. + * + * @param[in] aMessage A pointer to the message buffer containing the received Network Diagnostic + * Get response payload. + * @param[in] aMessageInfo A pointer to the message info for @p aMessage. + * @param[in] aContext A pointer to application-specific context. + * + */ +typedef void (*otReceiveDiagnosticGetCallback)(otMessage aMessage, const otMessageInfo *aMessageInfo, + void *aContext); + /** * @} * diff --git a/include/openthread.h b/include/openthread.h index 817e62aab..b670f811c 100644 --- a/include/openthread.h +++ b/include/openthread.h @@ -148,16 +148,6 @@ OTAPI void OTCALL otApiFinalize(otApiInstance *aApiInstance); */ OTAPI void OTCALL otFreeMemory(const void *aMem); -/** - * This function pointer is called to notify addition and removal of OpenThread devices. - * - * @param[in] aAdded A flag indicating if the device was added or removed. - * @param[in] aDeviceGuid A GUID indicating which device state changed. - * @param[in] aContext A pointer to application-specific context. - * - */ -typedef void (OTCALL *otDeviceAvailabilityChangedCallback)(bool aAdded, const GUID *aDeviceGuid, void *aContext); - /** * This function registers a callback to indicate OpenThread devices come and go. * @@ -336,16 +326,6 @@ OTAPI ThreadError OTCALL otThreadStop(otInstance *aInstance); */ OTAPI bool OTCALL otIsSingleton(otInstance *aInstance); -/** - * This function pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or - * the scan completes. - * - * @param[in] aResult A valid pointer to the beacon information or NULL when the active scan completes. - * @param[in] aContext A pointer to application-specific context. - * - */ -typedef void (OTCALL *otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext); - /** * This function starts an IEEE 802.15.4 Active Scan * @@ -371,16 +351,6 @@ OTAPI ThreadError OTCALL otActiveScan(otInstance *aInstance, uint32_t aScanChann */ OTAPI bool OTCALL otIsActiveScanInProgress(otInstance *aInstance); -/** - * This function pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the - * scan completes. - * - * @param[in] aResult A valid pointer to the energy scan result information or NULL when the energy scan completes. - * @param[in] aContext A pointer to application-specific context. - * - */ -typedef void (OTCALL *otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext); - /** * This function starts an IEEE 802.15.4 Energy Scan * @@ -871,15 +841,6 @@ OTAPI ThreadError OTCALL otAddUnicastAddress(otInstance *aInstance, const otNeti */ OTAPI ThreadError OTCALL otRemoveUnicastAddress(otInstance *aInstance, const otIp6Address *aAddress); -/** - * This function pointer is called to notify certain configuration or state changes within OpenThread. - * - * @param[in] aFlags A bit-field indicating specific state that has changed. - * @param[in] aContext A pointer to application-specific context. - * - */ -typedef void (OTCALL *otStateChangedCallback)(uint32_t aFlags, void *aContext); - /** * This function registers a callback to indicate when certain configuration or state changes within OpenThread. * @@ -1935,18 +1896,6 @@ OTAPI ThreadError OTCALL otGetParentInfo(otInstance *aInstance, otRouterInfo *aP */ OTAPI uint8_t OTCALL otGetStableNetworkDataVersion(otInstance *aInstance); -/** - * This function pointer is called when Network Diagnostic Get response is received. - * - * @param[in] aMessage A pointer to the message buffer containing the received Network Diagnostic - * Get response payload. - * @param[in] aMessageInfo A pointer to the message info for @p aMessage. - * @param[in] aContext A pointer to application-specific context. - * - */ -typedef void (*otReceiveDiagnosticGetCallback)(otMessage aMessage, const otMessageInfo *aMessageInfo, - void *aContext); - /** * This function registers a callback to provide received raw Network Diagnostic Get response payload. *