| 12345678910111213141516171819202122232425262728293031323334353637 |
- #include "nbus_impl.h"
- extern nBus_TypeDef nBus;
- nBus_functionCode_t* nbus_unicastToModule(nBus_TypeDef *nbus, nBus_functionCode_t *code){
- if(nbus->function_code.function == CMD_VERSION) {
- nbus->tx_buffer[4] = '0';
- nbus->tx_buffer[5] = '.';
- nbus->tx_buffer[6] = '1';
- nbus->tx_length += 3;
- code->error = 0;
- }
- if(nbus->function_code.function == CMD_ECHO) {
- for(uint8_t i=3 ; i<nbus->rx_length-1 ; i++){
- nbus->tx_buffer[i+1] = nbus->rx_buffer[i];
- }
- nbus->tx_length += (nbus->rx_length-4);
- code->error = 0;
- }
- return code;
- }
- void nbus_broadcast(nBus_TypeDef *nbus, nBusCommandType_t request_type){
- if(request_type == BROADCAST_SPECIFIC_SENSORS) {
- }
- if(request_type == BROADCAST_GLOBAL) {
- }
- nbus->send_response = NO_RESPONSE;
- }
|