Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.
/ chamge Public archive

[tʃɑmge] is edible, a small crab that lives in a river.

License

Notifications You must be signed in to change notification settings

hwangsaeul/chamge

Repository files navigation

Build Status

Chamge

Chamge[tʃɑmge] is a small crab in Korean and this module aims to provide control channel to the SRT relay server(hwangsae) and Edge(gaeguli).

This software is an AMQP client to gather information about edge and will instantiate the SRT relay on demand according to the current load.

libchamge1-diagram

Overview

Broker types

The connection broker API consists of three modules: Edge, Arbiter and Hub. Each broker instance can find itself in one of the following states: null, enrolled and activated.

Edge

Edge is a connection broker module for SRT Source Devices.

Arbiter

Arbiter is a connection broker module for SRT Management Servers.

Hub

Hub is a connection broker module for SRT Relay Servers.

States and transitions

Broker types states

  • null: this is the default initial state
  • enrolled: in this state the instance is registered in the message broker and able to exchange messages
  • activated: in this state the instance is ready to accept requests

Broker types requests and transitions

In order to become an active part of the system the node needs to transititon from the null state to the active one. Bellow is the list of requests the node can send and the transitions.

  • enroll: in the null or initial state the node performs this request using the backend to transition to the enrolled state.
  • activate: in the enrolled state the node performs this request using the backend to transition to the activated state.
  • deactivate: in the activated state the node performs this request using the backend to transition to the enroll state.
  • delist: in the enrolled state the node performs this request using the backend to transition to the initial state.

states-diagram

Agents

Role of agents are for communicating with another process. Agents include D-BUS API that is created by code generator from defined XML in the path of chamge/dbus/. Manager server's RESET API communicate with Arbiter via D-BUS(chamge-arbiter-agent).

D-BUS API

Arbiter D-BUS API

Status Retrieves the agent state, possible values are:

  • 0x0 = NULL
  • 0x1 = ENROLLED
  • 0x2 = ACTIVATED

Enroll Enrolls Edge device in the network

Delist Delists Edge device in the network

Activate Activates Edge device

Deactivate Deactivates Edge device

UserCommand Send user commamnd to a device

Arguments

  • command (s): Command to send

Return

  • result (i): Response status code
  • response (s): Response data

Edge D-BUS API

Status Retrieves the agent state, possible values are:

  • 0x0 = NULL
  • 0x1 = ENROLLED
  • 0x2 = ACTIVATED

Enroll Enrolls Edge device in the network

Delist Delists Edge device in the network

Activate Activates Edge device

Deactivate Deactivates Edge device

RequestSRTConnectionURI Request an SRT connection URI

Return

  • URI (s): URI to use to access SRT streaming.

Build from sources

To build from sources follow the procedure described in

Build from sources

Run

Examples

There are dummy files in examples folder. These are helper examples to implement edge/hub/arbiter.

Test Sequence of examples

  1. Run arbiter-dummy : Arbiter's status will go to activated status automatically. It will wait for the messages from edge/hub to enroll/activate.
  2. Run edge-dummy/hub-dummy : It will send enroll/activate to arbiter-dummy, and will be activated status after get response from arbiter-dummy.
  3. Input user-command : arbiter-dummy will send the sample user command according to user's key input. If you want to check what kind command you can use, try "h".

PPA nightly builds

Experimental versions of Chamge are daily generated in launchpad.

$ sudo add-apt-repository ppa:hwangsaeul/nightly
$ sudo apt-get update
$ sudo apt-get install libchamge1 libchamge-dev chamge-tools