Git Product home page Git Product logo

srf-ip-conn's Introduction

SharkRF IP Connector Protocol

This is the protocol used by SharkRF openSPOT's UDP API to allow 3rd party developers to create their own applications which communicate using openSPOT.

The protocol is designed for simplicity: strings are closed with zeroes, and packets have redundant fields. For example: call info can be extracted from raw DMR frames, but the protocol includes them in the packets separately, so 3rd party developers don't need to deal with call tracking.

You can find a demo client and server application in this repo. The server is a very simple implementation, it can only handle one client at a time. However, handling multiple clients could be added easily.

Note that openSPOT doesn't use call information sent to it in the packets. It always extracts all required info from raw data streams.

Pull requests are welcome!

Protocol Description

Login process

Client has to start the connection with the login process. If NAK is received or timeout happens during the process, client has to retry logging in later. At least 5 seconds should be kept between retries, as server ignores frequent auth requests.

Login Process Diagram

Max. password length is 32 characters. Server limits auth tries for only one in every 5 seconds. Packets with invalid HMAC are ignored.

Config update (optional)

Client can optionally update it's config information.

Config Process Diagram

Ping

Client should ping the server periodically at least once every 30 seconds (5 seconds is recommended to keep firewalls open) after the last packet has sent to the server. No need to send ping if client transmits in this 5 second timeframe. The server ends the connection after 30 seconds of client inactivity.

Ping Process Diagram

Data

Data packets can be sent in both directions.

Data Diagram

Closing the connection

Both participants can close the connection gracefully.

Close Process Diagram 1

Close Process Diagram 2

Packet Structure

The protocol uses UDP as transport layer. Server listens on port 65100 by default.

UDP packet (srf_ip_conn_packet_t) structure:

Header Payload

See srf-ip-conn/common/srf-ip-conn-packet.h for used packet structures. Byte order is big-endian.

srf-ip-conn's People

Contributors

nonoo avatar

Watchers

 avatar  avatar

Forkers

mjwaxios

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.