Aruna
comm.h
Go to the documentation of this file.
1 //
2 // Created by noeel on 7-1-19.
3 //
4 
5 #ifndef ARUNA_COMM_H
6 #define ARUNA_COMM_H
7 
8 #include "aruna/arunaTypes.h"
9 #include <aruna/comm/commTypes.h>
10 #include <aruna/comm/Link.h>
11 
12 namespace aruna {
13 
14  namespace comm {
15  // control functions
16 
23  err_t start();
24 
32  err_t start(Link *driver);
33 
41  err_t stop();
42 
52  err_t register_channel(channel_t *channel);
53 
61  err_t unregister_channel(channel_t &channel);
62 
79  // TODO documentation
80  err_t send(channel_t *channel, port_t to_port, uint8_t *data, size_t data_size, bool wait_for_ack = false);
81 
88  err_t pause();
89 
97  err_t resume();
98 
99  // getters and setters
100 
105  bool is_connected();
106 
112 
118 
127  err_t get_channels(char *buffer);
128 
134  unsigned int get_speed();
135 
145 
154 
158  void get_candidate_drivers(char *buffer[]);
159  // TODO come here and make it!
160 
169  err_t incoming_connection(uint8_t *package, uint8_t package_size);
170 
171  }
172 }
173 #endif //ARUNA_COMM_H
Definition: comm.cpp:14
uint8_t port_t
Definition: commTypes.h:30
unsigned int get_speed()
Get the speed of the link to the other hosts in bits per second.
Definition: comm.cpp:449
err_t register_channel(channel_t *channel)
Register a new communication endpoint.
Definition: comm.cpp:362
status_t get_status()
Get the running status of com.
Definition: comm.cpp:440
err_t send(channel_t *channel, port_t to_port, uint8_t *data, size_t data_size, bool wait_for_ack)
Send data.
Definition: comm.cpp:386
void get_candidate_drivers(char *buffer[])
get all the comm driver candidates
link_t get_link_type()
Get connection hardware type.
err_t unregister_candidate_driver(Link *driver)
unregister a driver to be a comdiver candidate
Definition: comm.cpp:497
err_t stop()
Stop the communication, free all queue&#39;s, channels and buffers.
Definition: comm.cpp:309
err_t resume()
resume all communication.
Definition: comm.cpp:348
Link * driver
stores the driver.
Definition: comm.cpp:45
err_t incoming_connection(uint8_t *package, uint8_t package_size)
Interrupt incomming connection handeler.
Definition: comm.cpp:453
bool is_connected()
Get the status of the comm link.
Definition: comm.cpp:436
err_t register_candidate_driver(Link *driver)
register a driver to be a comm driver candidate.
Definition: comm.cpp:479
err_t start()
Start new communication.
Definition: comm.cpp:251
err_t pause()
pause all communication.
Definition: comm.cpp:335
err_t get_channels(char *buffer)
get all names of the channels currently registered
Definition: comm.cpp:444
err_t unregister_channel(channel_t &channel)
unregister an endpoint
Definition: comm.cpp:378