The picture below shows the traffic. The messages Nr. 1,3,4,5 are the requests of the Gateway (ID 0x40000F) to the Sensors (IDs 0x400040, 0x400041, 0x400042). And message Nr. 2 and 6 are the replies of Sensor (ID 0x400040) with the Sensor data 0x55.
ADT WinEtel showing ADT telegrams
Application file - main.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
#include "string.h"
code uint8 VERSION_APP[] = {0xE0,'V','E','R','S','I','O','N',1,0,1,1,'A','A','D','T','G','A','T','E','W','A','Y',0x00,0xE0};
#define LED_CH3 WSDADIO_2
#define LED_CH2 SCLKDIO_1
#define LED_CH1 SCSEDIO_0
#define RADIO_BUFF_LENGTH 21
void main()
{
const uint32 u32SensorId[3] = {
0x0410007B,
0x04100021,
0x04100024,
};
uint8 u8SensorIdx;
uint32 u32MyId;
uint32 *pID;
uint8 u8SrcIdLength;
uint8 u8DstIdLength;
mainInit();
rTelTx.raw.
bytes[1] = 0x00;
rTelTx.raw.
bytes[2] = 0x00;
rTelTx.raw.
bytes[3] = 0x00;
rTelTx.raw.
bytes[4] = 0x00;
rTelTx.raw.
bytes[5] = 0x00;
rTelTx.raw.
bytes[6] = 0x00;
rTelTx.raw.
bytes[7] = 0x00;
rTelTx.raw.
bytes[8] = 0x00;
rTelTx.raw.
bytes[9] = 0x00;
u8SensorIdx = 0;
while(1)
{
{
memcpy(&rTelTx.raw.
bytes[5], (uint8 *)&u32SensorId[u8SensorIdx] , 4);
u8SensorIdx++;
if(u8SensorIdx >= 3)
u8SensorIdx = 0;
}
continue;
pID = (uint32*)
misc_getID2(&rTelRx, &u8SrcIdLength, &u8DstIdLength);
{
if(*pID == u32SensorId[0])
if(*pID == u32SensorId[1])
if(*pID == u32SensorId[2])
}
{
}
}
}
Config file - EO3100I_CFG.h
#ifndef _EO3100I_CFG_H_INCLUDED
#define _EO3100I_CFG_H_INCLUDED
void startupInit();
void mainInit();
#define RX_RING_SIZE 34
#define TX_RING_SIZE 34
extern volatile uint8 xdata u8RxRing[RX_RING_SIZE];
extern volatile uint8 xdata u8TxRing[TX_RING_SIZE];
extern uint8 uart_param[];
#define RADIO_BUFF_NUM 10
#define RADIO_MATURITY_TIME 100
#define FILTER_NUM 1
extern volatile uint32 xdata u32gFilterValue[FILTER_NUM];
extern volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
extern uint8 code io_param[];
#endif //_EO3100I_CFG_H_INCLUDED
Config file - EO3100I_CFG.c
#include "EO3100I_API.h"
#include "EO3100I_CFG.h"
void startupInit()
{
}
void mainInit()
{
}
volatile uint8 xdata u8RxRing[RX_RING_SIZE];
volatile uint8 xdata u8TxRing[TX_RING_SIZE];
uint8 uart_param[] = {
RX_RING_SIZE,
TX_RING_SIZE,
};
volatile uint32 xdata u32gFilterValue[FILTER_NUM];
volatile uint8 xdata u8gFilterCfg[FILTER_NUM];
uint8 code io_param[] = {
0x07,
0x00,
0x00,
0x07,
0x00,
0x00,
0xC0,
0x03,
0x80,
0x7F,
0x0C,
0x00,
0x00,
0x00,
0x00,
};