From a54ad9edce697133a024aff096e50f7e4f389d5b Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 18 Mar 2012 12:22:02 +0100 Subject: digital/beacon: import Zigbit stack (bitcloud) & avr sources --- digital/beacon/src/network.h | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 digital/beacon/src/network.h (limited to 'digital/beacon/src/network.h') diff --git a/digital/beacon/src/network.h b/digital/beacon/src/network.h new file mode 100644 index 00000000..c9734df4 --- /dev/null +++ b/digital/beacon/src/network.h @@ -0,0 +1,58 @@ +/**************************************************************************//** + \file Peer2Peer.h + + \brief Peer-2-peer sample application header file. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008 , Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 14.10.09 A. Taradov - Added FIFO for received packets +******************************************************************************/ + +#ifndef _NETWORK_H +#define _NETWORK_H + +// #define MAX_RETRIES_BEFORE_REJOIN 6 + +// typedef struct +// { +// uint8_t header[APS_ASDU_OFFSET]; +// uint8_t data; +// uint8_t footer[APS_AFFIX_LENGTH - APS_ASDU_OFFSET]; +// }buff_t; + + +typedef struct +{ + uint8_t messageId; // message ID + uint8_t data[APP_MAX_PACKET_SIZE]; // data +}AppMessage_t; + +// Application network messsage buffer descriptor +typedef struct +{ + uint8_t header[APS_ASDU_OFFSET]; // Auxiliary header (required by stack) + AppMessage_t message; // Application message + uint8_t footer[APS_AFFIX_LENGTH - APS_ASDU_OFFSET]; // Auxiliary footer (required by stack) +}AppMessageBuffer_t; + + + + +void APS_DataIndication(APS_DataInd_t* dataInd); +void APS_DataConf(APS_DataConf_t* confInfo); +void ZDO_StartNetworkConf(ZDO_StartNetworkConf_t* confirmInfo); +void initNetwork(void); +void startNetwork(void); +void send_data(void); +void send_angle(int angle_degree); + +#endif // ifndef _NETWORK_H + +// eof network.h -- cgit v1.2.3