|
|
@@ -1,60 +1,4 @@
|
|
|
|
|
|
-typedef int _Slave_ID_BROADCAST_T ;
|
|
|
-typedef int _SENDER_T ;
|
|
|
-
|
|
|
-
|
|
|
-//#define _Slave_ID_BROADCAST_T _Slave_ID_BROADCAST 0xFF ;
|
|
|
-
|
|
|
- #if ! defined(Active_ControllerID)
|
|
|
- #error "#9 not defined Active_ControllerID"
|
|
|
-
|
|
|
- #endif
|
|
|
-
|
|
|
- struct _Slave_Ports_Protocol_CAN_broadcast_S {
|
|
|
- const _Slave_ID_BROADCAST_T _Slave_ID_BROADCAST = 0xFF ; // 1remote id - use FF for broadcast
|
|
|
- const _SENDER_T _SENDER = Active_ControllerID ; //2 sender //Device which orginated port
|
|
|
- int Port_ID ; //3 global id for device //const char * const _Protocol;
|
|
|
- int PortTypes; //4 0xFF = 1111 1111 s
|
|
|
- //int Address ; //
|
|
|
- //int LocalPort; //
|
|
|
- int Exp_state; //5
|
|
|
- int Exp_state_ttl; //6
|
|
|
- int Broadcast_state; //7
|
|
|
- const int _CAN_8 = 0x07 ; //8 - nbot used
|
|
|
-} ;
|
|
|
-
|
|
|
-typedef struct _Slave_Ports_Protocol_CAN_broadcast_S _Slave_Ports_Protocol_CAN_broadcast_T;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-typedef int _CAN_SEND_1_T ; //1 byte = 0
|
|
|
-typedef int _CAN_SEND_2_T ; //2 byte = 8
|
|
|
-
|
|
|
- struct _Slave_Ports_Protocol_CAN_SEND_S {
|
|
|
- const _SENDER_T _SENDER = Active_ControllerID ;
|
|
|
- const _CAN_SEND_1_T _CAN_SEND_1 = 0 ;
|
|
|
- const _CAN_SEND_2_T _CAN_SEND_2 = 8 ;
|
|
|
- _Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A ;
|
|
|
-} ;
|
|
|
-
|
|
|
-//typedef byte _Slave_Ports_Protocol_CAN_broadcast_AS[8] ;
|
|
|
-
|
|
|
-/*
|
|
|
-
|
|
|
- struct _Slave_Ports_Protocol_CAN_broadcast_AS {
|
|
|
- const byte _Slave_ID_BROADCAST = 0xFF ; // 1remote id - use FF for broadcast
|
|
|
- const byte _SENDER = Active_ControllerID ; //2 sender //Device which orginated port
|
|
|
- byte Port_ID ; //3 global id for device //const char * const _Protocol;
|
|
|
- byte PortTypes; //4 0xFF = 1111 1111 s
|
|
|
- //int Address ; //
|
|
|
- //int LocalPort; //
|
|
|
- byte Exp_state; //5
|
|
|
- byte Exp_state_ttl; //6
|
|
|
- byte Broadcast_state; //7
|
|
|
- const byte _CAN_8 = 0x07 ; //8 - nbot used
|
|
|
-} ;
|
|
|
-*/
|
|
|
-typedef byte _Slave_Ports_Protocol_CAN_broadcast_AS[8] ;
|
|
|
|
|
|
void _Slave_Ports_Protocol_CAN_broadcast_AF(_Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A, byte* _Slave_Ports_Protocol_CAN_broadcast_B ) {
|
|
|
//byte dataa = {10, 12, 13, 4, 5, 6, 7, 8};
|
|
|
@@ -72,31 +16,3 @@ void _Slave_Ports_Protocol_CAN_broadcast_AF(_Slave_Ports_Protocol_CAN_broadcast_
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
- _Slave_Ports_Protocol_CAN_broadcast_AS _Slave_Ports_Protocol_CAN_broadcast_F( _Slave_Ports_Protocol_CAN_broadcast_T _Slave_Ports_Protocol_CAN_broadcast_A ) {
|
|
|
- byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
|
|
|
- return data;
|
|
|
-}
|
|
|
-*/
|
|
|
-/*byte data[8] = {
|
|
|
- int _Slave_ID --1 sender addr
|
|
|
- int 0x04, -2 task type
|
|
|
- int Port_ID ; -3 //global id for device //const char * const _Protocol;
|
|
|
- _Slave_Ports[i].PortTypes, -4
|
|
|
- _Slave_Ports[i].Exp_state, -5
|
|
|
- _Slave_Ports[i].Exp_state_ttl, -6
|
|
|
- Broadcast_state}; -7
|
|
|
- 0x07 -8 not used
|
|
|
-
|
|
|
-byte data[8] = {_Slave_Ports[i].Address, 1
|
|
|
- 0x04, 2
|
|
|
- _Slave_Ports[i].LocalPort, 3
|
|
|
- _Slave_Ports[i].PortTypes,4
|
|
|
- _Slave_Ports[i].LocalPort, 5
|
|
|
- _Slave_Ports[i].Exp_state,6
|
|
|
- _Slave_Ports[i].Exp_state_ttl,7
|
|
|
- 0x07};8
|
|
|
-
|
|
|
-
|
|
|
-byte sndStat = CAN0.sendMsgBuf(_Slave_Ports[i]._Slave_ID, 0, 8, data);
|
|
|
-*/
|