AudioScience HPI Version_4.10.

Network

The HPI Network object contains a series of parameters which are addressed using Uniform Resource Identifiers (URIs).

An example of a URI is "hpi://subsys/network/ip/enabled" which points to the HPI network parameter "enabled".

The function HPI_Object_UriToHandle() should be used to translate a URI into an HPI parameter handle. The parameter handle can then be used for set (write) or get (read) operations using HPI_Object_SetValue() and HPI_Object_GetValue().

URI data types

The list of supported datatypes is as follows:

entity_type_int

A 32 bit integer.

entity_type_ip4_address

4 byte IP4 address

Network Parameter URIs

hpi://subsystem/network/enabled
    Enable network traffic and device discovery
hpi://subsystem/network/ip/address
    Set the IP address of the network interface to use
hpi://subsystem/network/ip/mask
    Set the network IP mask
hpi://subsystem/network/ip/udp/broadcast_enabled
    Enable UDP broadcast discovery
hpi://subsystem/network/ip/udp/unicast_enabled
    Enable UDP unicast discovery
hpi://subsystem/network/ip/adapter_address_add
    Explicitly add an IP address to the HPIUDP list of discovered devices

URI List

URI hpi://subsystem/network/enabled
DescriptionEnable network traffic and device discovery.
off(0) : no network traffic will be generated or recieved
on(1) : network traffic is allowed, periodic discovery packets may be sent
The usual sequence would be to set up other hpiconfig options, and then call this function to start UDP running with the configured options.
Typeinteger / entity_type_int / C99 type int32_t
Count1
Attributesread/write
Default0
Added in version3.05.16
Example
hpi_handle_t h;
int netEnabled;
err = HPI_Object_UriToHandle("hpi://subsystem/network/enabled",  &h);
err = HPI_Object_GetValue(h, entity_type_int, 1,
                &netEnabled, sizeof(netEnabled) );
netEnabled = 1;
err = HPI_Object_SetValue(h, entity_type_int, 1,
                &netEnabled, sizeof(netEnabled));


URI hpi://subsystem/network/ip/address
DescriptionSet the IP address of the network interface to use
TypeIPv4 address / entity_type_ip4_address / C99 type int32_t
Count1
Attributesread/write
Defaultnone
Added in version3.05.16
Example
hpi_handle_t h;
struct in_addr ip_adr;
err = HPI_Object_UriToHandle("hpi://subsystem/network/ip/address", &h);
err = HPI_Object_GetValue(h, entity_type_ip4_address, 1,
                &ip_adr.s_addr, sizeof(ip_adr.s_addr));
ip_adr.s_addr = inet_addr("192.168.1.113");
err = HPI_Object_SetValue(h, entity_type_ip4_address, 1,
                &ip_adr.s_addr, sizeof(ip_adr.s_addr));


URI hpi://subsystem/network/ip/mask
DescriptionSet the network IP mask
TypeIPv4 address / entity_type_ip4_address / C99 type int32_t
Count1
Attributesread/write
Defaultnone
Added in version3.05.16
Example
hpi_handle_t h;
struct in_addr ip_adr;
err = HPI_Object_UriToHandle("hpi://subsystem/network/ip/mask", &h);
err = HPI_Object_GetValue(h, entity_type_ip4_address, 1,
                &ip_adr.s_addr, sizeof(ip_adr.s_addr));
ip_adr.s_addr = inet_addr("192.168.1.113");
err = HPI_Object_SetValue(h, entity_type_ip4_address, 1,
                &ip_adr.s_addr, sizeof(ip_adr.s_addr));


URI hpi://subsystem/network/ip/udp/broadcast_enabled
DescriptionEnable UDP broadcast discovery. Controls whether or not the HPIUDP module periodically sends broadcast UDP packets to discover AudioScience network devices. By default the broadcast discovery method is enabled.
Typeinteger / entity_type_int / C99 type int32_t
Count1
Attributesread/write
Default1
Added in version3.05.16
Example
hpi_handle_t h;
int udpBroadcastEnabled;
err = HPI_Object_UriToHandle("hpi://subsystem/network/ip/udp/broadcast_enabled",  &h);
err = HPI_Object_GetValue(h, entity_type_int, 1,
                &udpBroadcastEnabled, sizeof(udpBroadcastEnabled) );
udpBroadcastEnabled = 1;
err = HPI_Object_SetValue(h, entity_type_int, 1,
                &udpBroadcastEnabled, sizeof(udpBroadcastEnabled));


URI hpi://subsystem/network/ip/udp/unicast_enabled
DescriptionEnable UDP unicast discovery.When the unicast option is enabled the HPIUDP module will periodically send a packet to each "known" adapter to verify that it is still alive. By default this option is disabled. Using hpi_subsystem_network_ip_adapter_address_add will automatically turn this feature on.
Typeinteger / entity_type_int / C99 type int32_t
Count1
Attributesread/write
Default0
Added in version3.05.16
Example
hpi_handle_t h;
int udpUnicastEnabled;
err = HPI_Object_UriToHandle("hpi://subsystem/network/ip/udp/unicast_enabled",  &h);
err = HPI_Object_GetValue(h, entity_type_int, 1,
                &udpUnicastEnabled, sizeof(udpUnicastEnabled) );
udpUnicastEnabled = 1;
err = HPI_Object_SetValue(h, entity_type_int, 1,
                &udpUnicastEnabled, sizeof(udpUnicastEnabled));


URI hpi://subsystem/network/ip/adapter_address_add
DescriptionExplicitly add an IP address to the HPIUDP list of discovered devices. This call will cause the specified IP to be probed once to confirm it's presence. Additionally, if hpi_subsystem_network_ip_udp_unicast_enabled is false, it will be enabled.
TypeIPv4 address / entity_type_ip4_address / C99 type int32_t
Count1
Attributeswrite
Defaultnone
Added in version3.05.16
Example
hpi_handle_t h;
struct in_addr ip_adr;
err = HPI_Object_UriToHandle("hpi://subsystem/network/ip/adapter_address_add", &h);
ip_adr.s_addr = inet_addr("192.168.1.113");
err = HPI_Object_SetValue(h, entity_type_ip4_address, 1,
                &ip_adr.s_addr, sizeof(ip_adr.s_addr));