NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
boot.c
Go to the documentation of this file.
1
9#include "boot.h"
10
16 Message r;
17 uint8_t node = getNodeId(d);
18
19 if (m->cob_id == 0x140 && m->len == 3 && m->data[0] == node && m->data[1]==0 && m->data[2]==0){
20 r.data[0] = ObjDict_obj1018_Product_Code; // module type (last byte of bootloader)
21 r.data[1] = 0x02; // node is running an app
22 r.data[2] = (ObjDict_obj1018_Serial_Number) & 0xFF; //SN LB
23 r.data[3] = (ObjDict_obj1018_Serial_Number >> 8) & 0xFF; //SN HB
24 r.data[4] = (ObjDict_obj1018_Revision_Number >> 0) & 0xFF; //App Version Low Byte
25 r.data[5] = (ObjDict_obj1018_Revision_Number >> 8) & 0xFF; //App Version High Byte
26 r.data[6] = node;
27
28 r.len = 7;
29 r.rtr = NOT_A_REQUEST;
30 r.cob_id = 0x150;
31
32 return canSend(d->canHandle, &r);
33 }
34 else
35 {
36 return 0;
37 }
38}
#define UNS8
Unsigned int8 representation in CANFest.
Definition applicfg.h:25
UNS8 processBOOT(CO_Data *d, Message *m)
Initializes node ID and serial number data in the object dictionary.
Definition boot.c:15
UNS8 getNodeId(CO_Data *d)
Returns the nodId.
Definition states.c:250
Definition can.h:13
UNS16 cob_id
Definition can.h:14
UNS8 data[8]
Definition can.h:17
UNS8 rtr
Definition can.h:15
UNS8 len
Definition can.h:16
This structure contains all necessary informations to define a CANOpen node.
Definition data.h:44