#include "support/configCosmos.h"
#include "support/cosmos-errno.h"
#include "support/sliplib.h"
#include <cstring>
#include <iostream>
Go to the source code of this file.
int kissEncode |
( |
uint8_t * |
input, |
|
|
uint32_t |
count, |
|
|
uint8_t * |
packet |
|
) |
| |
185 uint32_t payload_bytes = 0;
190 printf(
"Error: Limit input to 255 8-bit character bytes\n");
201 *(packet+2) = (
'W' << 1);
202 *(packet+3) = (
'H' << 1);
203 *(packet+4) = (
'7' << 1);
204 *(packet+5) = (
'L' << 1);
205 *(packet+6) = (
'G' << 1);
206 *(packet+7) = (0x20 << 1);
210 *(packet+9) = (
'W' << 1);
211 *(packet+10) = (
'H' << 1);
212 *(packet+11) = (
'7' << 1);
213 *(packet+12) = (
'L' << 1);
214 *(packet+13) = (
'E' << 1);
215 *(packet+14) = (0x20 << 1);
244 *packet++ = input[
i];
255 return payload_bytes;
int i
Definition: rw_test.cpp:37
int count
Definition: rw_test.cpp:36
#define SLIP_FESC
SLIP Buffer Escape character.
Definition: sliplib.h:60
#define SLIP_TFEND
SLIP Buffer Escaped End character.
Definition: sliplib.h:64
#define SLIP_FEND
SLIP Buffer End character.
Definition: sliplib.h:56
#define SLIP_TFESC
SLIP Buffer Escaped Escape character.
Definition: sliplib.h:68
int kissDecode |
( |
uint8_t * |
kissed_input, |
|
|
uint32_t |
count, |
|
|
uint8_t * |
unload_packetd_payload |
|
) |
| |
Encoded payload will act as an intermediate packet holding the load_packetd data.
Frame end appended to packet after all the header is removed.
402 load_packetd_payload[j] = kissed_input[
i];
425 unload_packetd_payload[
i] = load_packetd_payload[j];
430 else if(load_packetd_payload[j+1] ==
SLIP_TFESC)
433 unload_packetd_payload[
i] = load_packetd_payload[j];
440 printf(
"Invalid Transpose Error!!!\n");
446 unload_packetd_payload[
i] = load_packetd_payload[j];
int i
Definition: rw_test.cpp:37
#define SLIP_FESC
SLIP Buffer Escape character.
Definition: sliplib.h:60
#define SLIP_TFEND
SLIP Buffer Escaped End character.
Definition: sliplib.h:64
#define SLIP_FEND
SLIP Buffer End character.
Definition: sliplib.h:56
#define PACKETMAX
Definition: ax25class.h:39
#define SLIP_TFESC
SLIP Buffer Escaped Escape character.
Definition: sliplib.h:68
int kissDecode |
( |
vector< uint8_t > |
kissed_input, |
|
|
KissHandle & |
handle |
|
) |
| |
322 unsigned char destination_call_sign[6];
323 uint8_t destination_station_id;
324 unsigned char source_call_sign[6];
325 uint8_t source_station_id;
333 destination_station_id = input[8];
334 source_station_id = input[15];
335 control_id = input[16];
336 protocol_id = input[17];
341 for(
int i=2;
i<=7;
i++)
343 destination_call_sign[
i-2] = input[
i] >> 1;
358 for(
int i=9;
i<=14;
i++)
360 source_call_sign[
i-9] = input[
i] >> 1;
int i
Definition: rw_test.cpp:37
void set_source_callsign(string source)
Definition: kisslib.cpp:106
void set_source_stationID(uint8_t ID)
Definition: kisslib.cpp:132
void set_protocolID(uint8_t protocol)
Definition: kisslib.cpp:154
void set_destination_callsign(string destination)
Definition: kisslib.cpp:69
void set_control(uint8_t control_number)
Definition: kisslib.cpp:143
void set_destination_stationID(uint8_t ID)
Definition: kisslib.cpp:95
void print_ascii |
( |
unsigned char * |
packet, |
|
|
unsigned int |
count |
|
) |
| |
void print_hex |
( |
unsigned char * |
packet, |
|
|
unsigned int |
count |
|
) |
| |