📄 binaryprotocol.txt
字号:
Binary Protocol for DVBStreamer===============================All integers will be in network byte order (ie big endian)Authentication will be used for changing channel adding pids/services etc, once aconnection has successfully sent an AUTH message that connection will be allowedto change channels/add outputs etc.The primary service is identifyable in the service filters list by the name"<Primary>".Common Types------------ -----------------------------STRING = |Length (Uint8)| Characters | -----------------------------IPPORT == STRING Where the string is expected to be in the format (IPv6) [::::]:UDPPort or (IPv4) x.x.x.x:UDPPort.Message Codes-------------1 Character describes type and whether it requires authentication.AUTH = Authenticate messageCxxx = Control MessagesSxxx = Status MessagesRxxx = Response messagesMessage Header--------------2 byte Message Code2 byte Message Length ----------------------------------------------- - |Message Code (uint16) | Data Length (uint16) | <--- DATA ---> | ----------------------------------------------- -Rxxx Standard Response Messages-------------------------------RERR = Response Error DATA ----------------------------------------- | Code (uint8) | Message string (STRING)| -----------------------------------------Code------CODES-START--=RERR0x00 = OK = Success0x01 = NOTAUTHORISED = Not authorised0x02 = EXISTS = Output Already Exists0x03 = NOTFOUND = Not found0x04 = STREAMING = Already streaming to requested ip:port0xFF = GENERIC = Generic Error (see message)--CODES-END--AUTH Authentication Message---------------------------AUTH = Authenticate DATA --------------------------------------- | Username (STRING)| password (STRING)| --------------------------------------- Password is in plain text (not ideal but should be ok for the moment) Responses : RERRINFO Information Message------------------------INFO = Information message DATA ---------------------------- |Field to Retrieve (uint8) | ---------------------------- Responses: RERR (OK, with message string containing the data)Field IDs-----------CODES-START--=INFO0x00 = NAME = Name (user defined) of this server0x01 = FETYPE = Front End Type0x02 = AUTHENTICATED = Is connection authenticated = "Authenticated" or "Not authenticated"0xFE = UPSECS = Uptime string in seconds ie "61" == 1 Minute 1 Second.0xFF = UPTIME = Uptime string "%d days %d hours %d minutes %d seconds"--CODES-END--Cxxx Control Messages---------------------CSxx = Control Service messagesCSPS = Control Service Primary Select - Select Primary Service DATA ----------------------- |Service Name (STRING)| ----------------------- Responses : RERRCSSA = Control Service Secondary Add - Add secondary service DATA ------------------------------------------------------- |Service Output Name (STRING)| Output Address (IPPORT)| ------------------------------------------------------- Responses : RERR (Output already exists, Already Streaming to IP:Port)CSSS = Control Service Secondary Select - Select a secondary service DATA ------------------------------------------------------- | Service Output Name (STRING) | Service Name (STRING)| ------------------------------------------------------- Responses : RERR (No Such Output)CSSR = Control Service Secondary Remove - Remove secondary service DATA ------------------------------ |Service Output Name (STRING)| ------------------------------ Responses: RERR (No Such Output)COxx = Control Output messagesCOAO = Control Output Add Output - Add a new output destination DATA ----------------------------------------------- | Output Name (STRING)|Output Address (IPPORT)| ----------------------------------------------- Responses : RERRCORO = Control Output Remove Output - Remove an output destination DATA ----------------------- | Output Name (STRING)| ----------------------- Responses : RERRCOAP = Control Output Add PIDs - Add pids to an output.CORP = Control Output remove PIDs - Remove pids from an output. DATA --------------------------------------------------------- - |Output Name (STRING)| PID Count (uint16) |PID (Uint16) | ... | --------------------------------------------------------- - Responses : RERRSxxx Status Messages--------------------SSxx = Status Service messagesSSPC = Status Service Primary Current - Return current service name for primary output. No Data section Responses: RERR (No Service Selected), RERR (OK, with message string containing the data)SSSL = Status Service Secondary List - List secondary outputs. No Data section Responses: RSSLSOLO = Status Outputs List outputs No Data section Responses: ROLOSOLP = Status Output List pids DATA ----------------------- | Output Name (STRING)| ----------------------- Responses: RPL, RERR (Output Not found)SOPC = Status Output Packet Count DATA ----------------------- | Output Name (STRING)| ----------------------- Responses: ROPC, RERR (Output Not found)STSS = Status TS Stats No Data section Responses: RTSSSFES = Status Front End Status No Data section Responses: RFESSSLA = Status Services List All - List all avaialable services No Data section Responses: RSLSSLM = Status Services List Multiplex - List services available on the current multiplex No Data section Responses: RSLSSPL = Status Services List PIDs DATA ----------------------- |Service Name (STRING)| ----------------------- Responses : RERR, RLPRxxx Response Messages----------------------RSSL = Response Service Secondary List DATA (header) ---------------------------------- | # of Secondary Services (uint8)| ---------------------------------- (repeated) ------------------------------------------------------------------------------- | Service Output Name (STRING) |Output Address (IPPORT)| Service Name (STRING)| -------------------------------------------------------------------------------ROLO = Response Outputs List outputs DATA (header) --------------------------------- | # of Secondary Outputs (uint8)| --------------------------------- (repeated) ---------------------------------------------- - |Output Name (STRING)|Output Address (IPPORT)| .....| ---------------------------------------------- -RLP = Response List pids DATA --------------------------------------- -- | # of PIDs (uint16) | PID 0 (uint16) | ..... | --------------------------------------- --ROPC = Response Output Packet Count DATA ------------------------- | Packet Count (uint32) | -------------------------RTSS = Response TS Stats DATA (PC = Packet count (uint32)) ---------------------------------------------------------- | bitrate (uint32) | Total PC | PAT PC | PMT PC | SDT PC | ----------------------------------------------------------RFES = Response Front End Status DATA --------------------------------------------------------------------------- | Status (uint8) | BER (uint32) | SNR (uint16) | Signal Strength (uint16) | ---------------------------------------------------------------------------RLS = Response Services List DATA ------------------------------------------------ -- |Services Count (uint16)| Service Name (STRING)| ... | ------------------------------------------------ --Message Codes/Names to Values-------------------------------CODES-START--=MSGCODE0x0000 = INFO = Information message0x0001 = AUTH = Authenticate0x1101 = CSPS = Control Service Primary Select - Select Primary Service0x1102 = CSSA = Control Service Secondary Add - Add secondary service0x1103 = CSSS = Control Service Secondary Select - Select a secondary service0x1104 = CSSR = Control Service Secondary Remove - Remove secondary service0x1201 = COAO = Control Output Add Output - Add a new output destination0x1202 = CORO = Control Output Remove Output - Remove an output destination0x1203 = COAP = Control Output Add PIDs - Add pids to an output.0x1204 = CORP = Control Output remove PIDs - Remove pids from an output.0x2101 = SSPS = Status Service Primary Service - Return current service name for primary service output.0x2102 = SSFL = Status Service Filter List - List service filters outputs.0x2103 = SSPC = Status Service Packet Count0x2201 = SOLO = Status Outputs List outputs0x2202 = SOLP = Status Output List pids0x2203 = SOPC = Status Output Packet Count0x2F01 = STSS = Status TS Stats0x2F02 = SFES = Status Front End Status0x2F03 = SSLA = Status Services List All - List all avaialable services0x2F04 = SSLM = Status Services List Multiplex - List services avaialable of the current multiplex0x2F05 = SSPL = Status Services List PIDs0xF001 = RSSL = Response Service Secondary List0xF002 = ROLO = Response Outputs List outputs0xF003 = RLP = Response Output List pids0xF004 = ROPC = Response Output Packet Count0xF005 = RTSS = Response TS Stats0xF006 = RFES = Response Front End Status0xF007 = RLS = Response Services List0xFFFF = RERR = Response Error--CODES-END--Script to produce header file-----------------------------Use binaryprotocol_cheader.awk to create the msgcodes.h file,orUse binaryprotocol_python.awk to create a python file containing all the codes.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -