Commit 593fa7c2 authored by Artem Prilutskiy's avatar Artem Prilutskiy

..

parent eb000bab
Pipeline #490 passed with stage
in 37 seconds
......@@ -483,7 +483,7 @@ int main(int argc, const char* argv[])
EV_SET(change, 1, EVFILT_TIMER, EV_ADD | EV_ENABLE, NOTE_SECONDS, REWIND_KEEP_ALIVE_INTERVAL, 0);
change ++;
EV_SET(change, 2, EVFILT_TIMER, EV_ADD | EV_ENABLE, NOTE_USECONDS, TDMA_FRAME_DURATION, 0);
EV_SET(change, 2, EVFILT_TIMER, EV_ADD | EV_ENABLE, NOTE_MSECONDS, TDMA_FRAME_DURATION, 0);
change ++;
EV_SET(change, SIGINT, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0, 0);
......
......@@ -22,31 +22,36 @@ extern "C"
#define REWIND_CLASS_DEVICE_DATA 0x0800
#define REWIND_CLASS_APPLICATION 0x0900
#define REWIND_CLASS_KAIROS_DATA (REWIND_CLASS_DEVICE_DATA + 0x00)
#define REWIND_CLASS_HYTERA_DATA (REWIND_CLASS_DEVICE_DATA + 0x10)
#define REWIND_CLASS_KAIROS_DATA (REWIND_CLASS_DEVICE_DATA + 0x00)
#define REWIND_CLASS_HYTERA_DATA (REWIND_CLASS_DEVICE_DATA + 0x10)
#define REWIND_TYPE_KEEP_ALIVE (REWIND_CLASS_REWIND_CONTROL + 0)
#define REWIND_TYPE_CLOSE (REWIND_CLASS_REWIND_CONTROL + 1)
#define REWIND_TYPE_CHALLENGE (REWIND_CLASS_REWIND_CONTROL + 2)
#define REWIND_TYPE_AUTHENTICATION (REWIND_CLASS_REWIND_CONTROL + 3)
#define REWIND_TYPE_KEEP_ALIVE (REWIND_CLASS_REWIND_CONTROL + 0)
#define REWIND_TYPE_CLOSE (REWIND_CLASS_REWIND_CONTROL + 1)
#define REWIND_TYPE_CHALLENGE (REWIND_CLASS_REWIND_CONTROL + 2)
#define REWIND_TYPE_AUTHENTICATION (REWIND_CLASS_REWIND_CONTROL + 3)
#define REWIND_TYPE_REPORT (REWIND_CLASS_SYSTEM_CONSOLE + 0)
#define REWIND_TYPE_REPORT (REWIND_CLASS_SYSTEM_CONSOLE + 0)
#define REWIND_TYPE_BUSY_NOTICE (REWIND_CLASS_SERVER_NOTICE + 0)
#define REWIND_TYPE_ADDRESS_NOTICE (REWIND_CLASS_SERVER_NOTICE + 1)
#define REWIND_TYPE_BINDING_NOTICE (REWIND_CLASS_SERVER_NOTICE + 2)
#define REWIND_TYPE_BUSY_NOTICE (REWIND_CLASS_SERVER_NOTICE + 0)
#define REWIND_TYPE_ADDRESS_NOTICE (REWIND_CLASS_SERVER_NOTICE + 1)
#define REWIND_TYPE_BINDING_NOTICE (REWIND_CLASS_SERVER_NOTICE + 2)
#define REWIND_TYPE_EXTERNAL_SERVER (REWIND_CLASS_KAIROS_DATA + 0)
#define REWIND_TYPE_REMOTE_CONTROL (REWIND_CLASS_KAIROS_DATA + 1)
#define REWIND_TYPE_SNMP_TRAP (REWIND_CLASS_KAIROS_DATA + 2)
#define REWIND_TYPE_EXTERNAL_SERVER (REWIND_CLASS_KAIROS_DATA + 0)
#define REWIND_TYPE_REMOTE_CONTROL (REWIND_CLASS_KAIROS_DATA + 1)
#define REWIND_TYPE_SNMP_TRAP (REWIND_CLASS_KAIROS_DATA + 2)
#define REWIND_TYPE_PEER_DATA (REWIND_CLASS_HYTERA_DATA + 0)
#define REWIND_TYPE_RDAC_DATA (REWIND_CLASS_HYTERA_DATA + 1)
#define REWIND_TYPE_MEDIA_DATA (REWIND_CLASS_HYTERA_DATA + 2)
#define REWIND_TYPE_PEER_DATA (REWIND_CLASS_HYTERA_DATA + 0)
#define REWIND_TYPE_RDAC_DATA (REWIND_CLASS_HYTERA_DATA + 1)
#define REWIND_TYPE_MEDIA_DATA (REWIND_CLASS_HYTERA_DATA + 2)
#define REWIND_TYPE_SUBSCRIPTION (REWIND_CLASS_APPLICATION + 0x00)
#define REWIND_TYPE_DMR_DATA_BASE (REWIND_CLASS_APPLICATION + 0x10)
#define REWIND_TYPE_DMR_AUDIO_FRAME (REWIND_CLASS_APPLICATION + 0x20)
#define REWIND_TYPE_CONFIGURATION (REWIND_CLASS_APPLICATION + 0x00)
#define REWIND_TYPE_SUBSCRIPTION (REWIND_CLASS_APPLICATION + 0x01)
#define REWIND_TYPE_CANCELLING (REWIND_CLASS_APPLICATION + 0x02)
#define REWIND_TYPE_DMR_DATA_BASE (REWIND_CLASS_APPLICATION + 0x10)
#define REWIND_TYPE_DMR_AUDIO_FRAME (REWIND_CLASS_APPLICATION + 0x20)
#define REWIND_TYPE_DMR_EMBEDDED_DATA (REWIND_CLASS_APPLICATION + 0x27)
#define REWIND_TYPE_SUPER_HEADER (REWIND_CLASS_APPLICATION + 0x28)
#define REWIND_TYPE_FAILURE_CODE (REWIND_CLASS_APPLICATION + 0x29)
#define REWIND_FLAG_NONE 0
#define REWIND_FLAG_REAL_TIME_1 (1 << 0)
......@@ -60,6 +65,11 @@ extern "C"
#define REWIND_SERVICE_TELLUS_AGENT (REWIND_ROLE_REPEATER_AGENT + 1)
#define REWIND_SERVICE_SIMPLE_APPLICATION (REWIND_ROLE_APPLICATION + 0)
#define REWIND_OPTION_SUPER_HEADER (1 << 0)
#define REWIND_OPTION_LINEAR_FRAME (1 << 1)
#define REWIND_CALL_LENGTH 10
struct RewindVersionData
{
uint32_t number; // Remote ID
......@@ -67,6 +77,8 @@ struct RewindVersionData
char description[0]; // Software name and version
};
// Generic Data Structures
struct RewindAddressData
{
struct in_addr address;
......@@ -78,12 +90,30 @@ struct RewindBindingData
uint16_t ports[0];
};
// Simple Application Protocol
struct RewindConfigurationData
{
uint32_t options; // REWIND_OPTION_*
};
struct RewindSubscriptionData
{
uint32_t type;
uint32_t number;
uint32_t type; // SESSION_TYPE_*
uint32_t number; // Destination ID
};
struct RewindSuperHeader
{
uint32_t type; // SESSION_TYPE_*
uint32_t sourceID; // Source ID or 0
uint32_t destinationID; // Destination ID or 0
char sourceCall[REWIND_CALL_LENGTH]; // Source Call or zeros
char destinationCall[REWIND_CALL_LENGTH]; // Destination Call or zeros
};
// Rewind Transport Layer
struct RewindData
{
char sign[REWIND_SIGN_LENGTH];
......
......@@ -5,12 +5,18 @@
void PokeData(struct RingBuffer* buffer, uint32_t number, uint8_t* data, size_t length)
{
struct BufferRecord* record;
number %= BUFFER_LENGTH;
buffer->delay += buffer->marks == 0; // Postpone processing if buffer empty
buffer->marks |= 1 << number; // Set processing mark for the record
if (buffer->marks == 0)
{
buffer->delay ++;
buffer->index = number;
}
struct BufferRecord* record = buffer->records + number;
buffer->marks |= 1 << number;
record = buffer->records + number;
record->length = length;
memcpy(record->data, data, length);
......
#define VERSION 20160812
#define VERSION 20170604
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment