UDC2 Libraries

The udc2.h header file defines the interface between the Beacon and a UDC2 implementation.

void udc2_init ( );
int  udc2_go   ( const char * out_data, const size_t out_data_len, char ** in_data, size_t * in_data_len );
void udc2_free ( );

udc2_init

udc2_init is called once by the Beacon when it starts running. Use this to allocate any resources that you need.

udc2_free

udc2_free is called once by the Beacon just before it exists. Use this to free any resources that you allocated.

udc2_go

udc2_go is called by the Beacon to perform a check-in or send output to the server, where:

  • out_data is a pointer to the data being sent by the Beacon.

  • out_data_len is the length of the data being sent.

  • in_data is a pointer to receive a pointer containing the data response sent by the server.

  • in_data_len is a pointer to receive the length of the server's response.

circle-info

The Beacon calls free on both the out_data and in_data pointers once it has finished processing the data.

You must package your UDC2 COFF(s) into a ZIP file so that they're compatible with Crystal Palace's mergelibarrow-up-right command.

Last updated