summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--digital/zigbit/common/network.h3
-rw-r--r--digital/zigbit/common/network_send_commands.c21
-rw-r--r--digital/zigbit/common/network_send_commands.h3
3 files changed, 26 insertions, 1 deletions
diff --git a/digital/zigbit/common/network.h b/digital/zigbit/common/network.h
index 5f771218..0245801d 100644
--- a/digital/zigbit/common/network.h
+++ b/digital/zigbit/common/network.h
@@ -51,7 +51,8 @@ typedef enum
NETWORK_OPPONENT_NUMBER,
NETWORK_ANGLE_RAW,
NETWORK_RESET,
- NETWORK_UART_OVER_ZB
+ NETWORK_UART_OVER_ZB,
+ NETWORK_START_CALIBRATION
} TMessage_type;
diff --git a/digital/zigbit/common/network_send_commands.c b/digital/zigbit/common/network_send_commands.c
index 6398d335..a2be7a3c 100644
--- a/digital/zigbit/common/network_send_commands.c
+++ b/digital/zigbit/common/network_send_commands.c
@@ -160,4 +160,25 @@ void network_send_jack_state(uint16_t address,uint8_t state)
}
}
+/* This function must be used to send calibration command through zigbee network */
+void network_send_start_calibration()
+{
+
+ if(network_get_state() == APP_NETWORK_JOINED_STATE)
+ {
+ /* Configure network for tx */
+ network_TX_prepare_configuration();
+ network_config.dstAddress.shortAddress = 0xFFFF; // Destination address
+ network_config.asdu = (uint8_t*) &zigbit_tx_buffer.message; // application message pointer
+
+ /* Message type*/
+ zigbit_tx_buffer.message.type = NETWORK_START_CALIBRATION;
+
+ /* Bitcloud sending request */
+ network_config.asduLength = sizeof(zigbit_tx_buffer.message.type); // actual application message length
+
+ network_start_transmission();
+ }
+}
+
diff --git a/digital/zigbit/common/network_send_commands.h b/digital/zigbit/common/network_send_commands.h
index 116c8a10..14ad9f9c 100644
--- a/digital/zigbit/common/network_send_commands.h
+++ b/digital/zigbit/common/network_send_commands.h
@@ -38,4 +38,7 @@ void network_send_reset(uint16_t address);
/* This function must be used to send jack state through zigbee network */
void network_send_jack_state(uint16_t address,uint8_t state);
+/* This function must be used to send calibration command through zigbee network */
+void network_send_start_calibration();
+
#endif