![Neo.cortec NCxxxx series Скачать руководство пользователя страница 14](http://html1.mh-extra.com/html/neo-cortec/ncxxxx-series/ncxxxx-series_integration-manual_718966014.webp)
- 14 of 18 –
neo.
cortec
.
The application layer can register for
HostDataCallback
. The callback is issued when
the modules receives payload data from another module in the NEOCORTEC mesh
network. The callback function delivers a pointer to a struct containing the following
information: OriginatorID, Port number, PayloadLength, Packet Age & Payload.
The application layer can register for
HostDataHapaCallback
. The callback is issued
when the modules receives payload data from another module in the NEOCORTEC
mesh network which has been configured to use the High Precision Packet Age feature.
The callback function delivers a pointer to a struct containing the following information:
OriginatorID, Port number, PayloadLength, Packet Age & Payload.
To enable the API on a particular embedded controller, certain support functions are
required, which are specific to the controller:
The API will call
NcApiTxData
every time data is to be written to the UART. The function
is called with a pointer to the actual data, which is to be written. The function shall
implement the necessary code required to output the data to the UART.
The API will call
NcApiMessageWrittenCallback
once a message has successfully been
written in full to the module. This can be used by the application layer to check that a
previous call to NcApiSendAcknowledged was completed successfully.
Similarly, there are functions inside the API, which has to be called when certain events
occur:
NcApiCallbackCtsActive
is a function inside the API, which shall be called each time
the CTS line on the UART transitions to active (low) state. As such, an interrupt handler
for the particular pin on the controller must be implemented, such that the API is
“aware” of when CTS is active. There is no need to do anything when the CTS line
transitions to passive (high).
NcApiRxDataReceived
is a function inside the API, which shall be called each time a
byte is received on the UART. The byte shall be included as an argument when the
function is called.
The functions related to Wireless Encrypted Setup are not mentioned here, but are fully
documented in the API documentation.