CanProtobuf.hpp File Reference

Exchange Protobuf messages over CAN module. More...

Detailed Description

Exchange Protobuf messages over CAN module.

This module provides a class that controls an CAN to send and receive Protobuf messages using EmbbededProto. Each library/application using canpb must define a unique id (32-bit integer of type cogip::canpb::uuid_t) and registrer a callback function to send or receive their own messages. See examples/canb.

Author
Gilles DOFFE g.dof.nosp@m.fe@g.nosp@m.mail..nosp@m.com
Eric Courtois eric..nosp@m.cour.nosp@m.tois@.nosp@m.gmai.nosp@m.l.com

Definition in file CanProtobuf.hpp.

#include "etl/delegate.h"
#include <mutex.h>
#include "can/conn/raw.h"
#include "periph/can.h"
#include "ringbuffer.h"
#include "thread.h"
#include "etl/map.h"
#include "canpb/canpb.hpp"
#include "canpb/ReadBuffer.hpp"
#include "canpb/WriteBuffer.hpp"
#include "MessageInterface.h"
+ Include dependency graph for CanProtobuf.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  cogip::canpb::CanProtobuf
 Generic CAN Protobuf communication class. More...
 

Namespaces

 cogip
 Differential drive controller.
 

Typedefs

using cogip::canpb::uuid_t = uint32_t
 Custom type for uuids.
 
using cogip::canpb::message_handler_t = etl::delegate< void(cogip::canpb::ReadBuffer &)>
 Prototype for incoming Protobuf message handlers.
 

Functions

void * cogip::canpb::message_reader_wrapper (void *arg)
 Thread function decoding incoming Protobuf messages. More...
 
#define CAN_BUFFER_SIZE   CANPB_INPUT_MESSAGE_LENGTH_MAX*2
 

Function Documentation

◆ message_reader_wrapper()

void* cogip::canpb::message_reader_wrapper ( void *  arg)

Thread function decoding incoming Protobuf messages.

This wrapper is used to call the message_reader() function from CanProtobuf class from C context, passing the CanProtobuf instance pointer as first parameter.

Parameters
[in]arg[in] pointer to CanProtobuf instance