28 lines
816 B
C
28 lines
816 B
C
|
//
|
||
|
// Created by nicol on 2018-03-18.
|
||
|
//
|
||
|
|
||
|
#ifndef ESC_TCP_PACKAGE_H
|
||
|
#define ESC_TCP_PACKAGE_H
|
||
|
|
||
|
#include "buffer.h"
|
||
|
#include "uuid.h"
|
||
|
|
||
|
struct st_tcp_package {
|
||
|
uint8_t command;
|
||
|
uint8_t flags;
|
||
|
esc_uuid_t correlation_id;
|
||
|
const char* login;
|
||
|
const char* password;
|
||
|
buffer_t data;
|
||
|
};
|
||
|
typedef struct st_tcp_package tcp_package_t;
|
||
|
|
||
|
const tcp_package_t* tcp_package_create(uint8_t command, const esc_uuid_t* correlation_id, buffer_t data);
|
||
|
const tcp_package_t* tcp_package_create_authenticated(uint8_t command, const esc_uuid_t* correlation_id, buffer_t data, const char* username, const char* password);
|
||
|
void tcp_package_free(const tcp_package_t* pkg);
|
||
|
buffer_t tcp_package_to_buffer(const tcp_package_t* pkg);
|
||
|
const tcp_package_t* tcp_package_from_buffer(buffer_t buffer);
|
||
|
|
||
|
#endif //ESC_TCP_PACKAGE_H
|