|
ITS
|
#include <api.h>Go to the source code of this file.
Functions | |
| void | empty_buffer (FILE *stream) |
| bool | read_stdin (char *msg, int length, FILE *stream) |
| void | format (unsigned char *msg, unsigned long v, int l) |
| format Format a number in byte array. More... | |
| unsigned long long int | split (const unsigned char *msg, int begin, int end) |
| split Extract number from byte array. More... | |
| void | split (const unsigned char *msg, int begin, int end, char *out) |
| split Extract sub byte array from byte array More... | |
| void | read_opts (const unsigned char *msg, int nOptions, bool *opts) |
| void | clear_string (char *s, int n) |
| void | print_hexa (const unsigned char *msg, int l, FILE *stream) |
| print_hexa Print a byte array. More... | |
| QByteArray | hexa2bin (QByteArray src) |
| QByteArray | split (QByteArray src, int begin, int end) |
| QString | printBitString (BIT_STRING_t b) |
| printBitString Print a BIT_STRING into a QString. More... | |
| int | validate_unsigned_int (cfg_t *cfg, cfg_opt_t *opt) |
| validate_unsigned_int Check if an option is an unsigned int More... | |
| BIT_STRING_t | makeBitString (int nbits, cfg_t *cfg, const char *opt_name) |
| makeBitString Generate a BIT_STRING from configuration. More... | |
| quint64 | circAtLat (long l) |
| circAtLat Compute the circumference at a latitude. More... | |
| unsigned int | diameter (long begin, long end, quint64 circ) |
| diameter Compute the distance between two point on the same latitude. More... | |
| double | dist (qint32 x1, qint32 y1, qint32 x2, qint32 y2) |
| dist This function calculate the euclidian distance between two points ([x1, y1], [x2, y2]). More... | |
| double | f (long x, long y, double lengthA, double lengthB, e_shape shape) |
| f Compute the f function. More... | |
| int | g (double dist_r, double dist_f, double dist_fr, int angleThreshold) |
| g Compute the g function. More... | |
| quint64 circAtLat | ( | long | l | ) |
circAtLat Compute the circumference at a latitude.
| l | The latitude. |
Definition at line 211 of file api.cpp.
References EARTH_RADIUS.
Referenced by GeoNet::advancedForwarding(), GeoNet::contentionBasedForwardingAlgorithm(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), denMessageTableForwarding::inRelevanceArea(), GeoNet::sendGAC(), and GeoNet::simpleForwardingAlgorithm().
| unsigned int diameter | ( | long | begin, |
| long | end, | ||
| quint64 | circ | ||
| ) |
diameter Compute the distance between two point on the same latitude.
| begin | The first point. |
| end | The seconde point. |
| circ | The circumference at the latitude. |
Definition at line 220 of file api.cpp.
Referenced by GeoNet::advancedForwarding(), GeoNet::contentionBasedForwardingAlgorithm(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), denMessageTableForwarding::inRelevanceArea(), GeoNet::sendGAC(), and GeoNet::simpleForwardingAlgorithm().
| double dist | ( | qint32 | x1, |
| qint32 | y1, | ||
| qint32 | x2, | ||
| qint32 | y2 | ||
| ) |
dist This function calculate the euclidian distance between two points ([x1, y1], [x2, y2]).
| x1 | X1 is the latitude of the first point. |
| y1 | Y1 is the longitude of the first point. |
| x2 | X2 is the latitude of the second point. |
| y2 | Y2 is the longitude of the second point. |
Definition at line 228 of file api.cpp.
Referenced by GeoNet::advancedForwarding(), GeoNet::CBFUnicast(), caBasicService::checkCamGeneration(), GeoNet::contentionBasedForwardingAlgorithm(), and GeoNet::greedy().
| void empty_buffer | ( | FILE * | stream | ) |
Definition at line 3 of file api.cpp.
Referenced by read_stdin().
| double f | ( | long | x, |
| long | y, | ||
| double | lengthA, | ||
| double | lengthB, | ||
| e_shape | shape | ||
| ) |
f Compute the f function.
| x | The x position of the point. |
| y | The y position of the point. |
| lengthA | The length of the semi minor axis. |
| lengthB | The length of the semi major axis. |
| shape | The shape of the area. |
Definition at line 236 of file api.cpp.
References shape_circle, shape_ellipse, shape_none, and shape_rectangle.
Referenced by GeoNet::advancedForwarding(), ber_tlv_tag_fwrite(), GeoNet::contentionBasedForwardingAlgorithm(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), denMessageTableForwarding::inRelevanceArea(), GeoNet::sendGAC(), AppDenmResultData::setFailureNotification(), and GeoNet::simpleForwardingAlgorithm().
| void format | ( | unsigned char * | msg, |
| unsigned long | v, | ||
| int | l | ||
| ) |
format Format a number in byte array.
| msg | The byte array. |
| v | The number to format. |
| l | The intended byte number. |
Definition at line 35 of file api.cpp.
Referenced by SecurityProfile_CAM::secureHeader(), and GeoNet::send().
| int g | ( | double | dist_r, |
| double | dist_f, | ||
| double | dist_fr, | ||
| int | angleThreshold | ||
| ) |
g Compute the g function.
| dist_r | Distance to the router. |
| dist_f | Distance to the forwarder. |
| dist_fr | FSR. |
| angleThreshold | ANGLE_TH. |
Definition at line 272 of file api.cpp.
References itsGnDefaultMaxCommunicationRange.
Referenced by GeoNet::advancedForwarding(), constr_GenerationDeltaTime(), cpy_GenerationDeltaTime(), make_GenerationDeltaTime(), and setGenerationDeltaTime().
| BIT_STRING_t makeBitString | ( | int | nbits, |
| cfg_t * | cfg, | ||
| const char * | opt_name | ||
| ) |
makeBitString Generate a BIT_STRING from configuration.
| nbits | Number of bits needed. |
| cfg | The configuration. |
| opt_name | The option name. |
Definition at line 198 of file api.cpp.
References BIT_STRING_s::bits_unused, BIT_STRING_s::buf, and BIT_STRING_s::size.
Referenced by ParameterCAN::read(), ParameterApplication::read(), and ParameterConfiguration::read().
| void print_hexa | ( | const unsigned char * | msg, |
| int | l, | ||
| FILE * | stream = stdout |
||
| ) |
print_hexa Print a byte array.
| msg | The byte array |
| l | The byte array length |
| stdout | The output stream. |
Definition at line 89 of file api.cpp.
References NEW_LINE, and OCTET.
Referenced by denTriggeringManagement::AppDENM_cancellation(), denReceptionManagement::AppDENM_negation(), denTriggeringManagement::AppDENM_trigger(), caReceptionManagement::decodeCam(), and UpperTester::readPendingDatagrams().
| QString printBitString | ( | BIT_STRING_t | b | ) |
printBitString Print a BIT_STRING into a QString.
| b | The BIT_STRING to print. |
Definition at line 175 of file api.cpp.
References BIT_STRING_s::bits_unused, BIT_STRING_s::buf, and BIT_STRING_s::size.
Referenced by ParameterCAN::readDebug(), ParameterApplication::readDebug(), and ParameterConfiguration::readDebug().
| void read_opts | ( | const unsigned char * | msg, |
| int | nOptions, | ||
| bool * | opts | ||
| ) |
| bool read_stdin | ( | char * | msg, |
| int | length, | ||
| FILE * | stream | ||
| ) |
Definition at line 11 of file api.cpp.
References empty_buffer().
| unsigned long long int split | ( | const unsigned char * | msg, |
| int | begin, | ||
| int | end | ||
| ) |
split Extract number from byte array.
| msg | The byte array. |
| begin | Start bit. |
| end | End bit |
Definition at line 47 of file api.cpp.
Referenced by Facilities::getNetworkAndTransportLayerIndication().
| void split | ( | const unsigned char * | msg, |
| int | begin, | ||
| int | end, | ||
| char * | out | ||
| ) |
| int validate_unsigned_int | ( | cfg_t * | cfg, |
| cfg_opt_t * | opt | ||
| ) |
validate_unsigned_int Check if an option is an unsigned int
| cfg | Configuration file. |
| opt | Parameter list. |
Definition at line 186 of file api.cpp.
Referenced by ParameterUpperTester::read(), ParameterGPS::read(), ParameterCAN::read(), ParameterApplication::read(), and ParameterConfiguration::read().