Ethernet Entity

See the Ethernet Entity for generic information.

group EthernetEntity

IP configuration. MAC info. BrainD port.

void ethernet_setEnabled(unsigned int *id, struct Result *result, const int index, const unsigned char enabled)

Sets the Ethernet’s interface to enabled/disabled.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • enabled – 1 = enabled; 0 = disabled

void ethernet_getEnabled(unsigned int *id, struct Result *result, const int index)

Gets the current enable value of the Ethernet interface.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void ethernet_getNetworkConfiguration(unsigned int *id, struct Result *result, const int index)

Get the method in which IP Address is assigned to this device

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

void ethernet_setNetworkConfiguration(unsigned int *id, struct Result *result, const int index, const unsigned char addressStyle)

Get the method in which IP Address is assigned to this device

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • addressStyle – Method to use. See getNetworkConfiguration for addressStyle enumerations.

void ethernet_getStaticIPv4Address(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the expected IPv4 address of this device, when networkConfiguration == STATIC

The result parameter will output the following fields:

Note

The functional IPv4 address of The Module will differ if NetworkConfiguration != STATIC.

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_setStaticIPv4Address(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, const unsigned int bufferLength)

Set the desired IPv4 address of this device, if NetworkConfiguration == STATIC.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] with an IP address

  • bufferLength – size of buffer. Should be 4.

void ethernet_getStaticIPv4Netmask(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the expected IPv4 netmask of this device, when networkConfiguration == STATIC

The result parameter will output the following fields:

Note

The functional IPv4 netmask of The Module will differ if NetworkConfiguration != STATIC.

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_setStaticIPv4Netmask(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, const unsigned int bufferLength)

Set the desired IPv4 address of this device, if NetworkConfiguration == STATIC

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] with an IP address

  • bufferLength – size of buffer. Should be 4.

void ethernet_getStaticIPv4Gateway(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the expected IPv4 gateway of this device, when networkConfiguration == STATIC

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_setStaticIPv4Gateway(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, const unsigned int bufferLength)

Set the desired IPv4 gateway of this device, if NetworkConfiguration == STATIC

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] with an IP address

  • bufferLength – size of buffer. Should be 4. setStaticIPv4Gateway([192, 168, 1, 1], 4) would equate with address “192.168.1.1”

void ethernet_getIPv4Address(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the effective IP address of this device.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_getIPv4Netmask(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the effective IP netmask of this device.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_getIPv4Gateway(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the effective IP gateway of this device.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[4] for returned output

  • bufferLength – size of buffer. Should be 4.

void ethernet_setStaticIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, const unsigned int bufferLength)

Set IPv4 DNS Addresses (plural), if NetworkConfiguration == STATIC

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[N][4]

  • bufferLength – Total array length in bytes. Must be a multiple of 4.

void ethernet_getStaticIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get IPv4 DNS addresses (plural), when NetworkConfiguration == STATIC

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[N][4]

  • bufferLength – Maximum length of array, in bytes.

void ethernet_getIPv4DNSAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get effective IPv4 DNS addresses, for the current NetworkConfiguration

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[N][4]

  • bufferLength – Maximum length of array, in bytes.

void ethernet_setHostname(unsigned int *id, struct Result *result, const int index, const unsigned char *buffer, const unsigned int bufferLength)

Set hostname that’s requested when this device sends a DHCP request.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[N]

  • bufferLength – N, for N bytes.

void ethernet_getHostname(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get hostname that’s requested when this device sends a DHCP request.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[N]

  • bufferLength – N, for N bytes.

void ethernet_getMACAddress(unsigned int *id, struct Result *result, const int index, unsigned char *buffer, const unsigned int bufferLength)

Get the MAC address of the Ethernet interface.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • buffer – alias to an array of uint8_t[6]

  • bufferLength – length of buffer that’s writeable, should be > 6.

void ethernet_setInterfacePort(unsigned int *id, struct Result *result, const int index, const unsigned char service, const unsigned short port)

Set the port of a TCPIP service on the device.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • service – The index of the service to set the port for.

  • port – The port to be used for the TCPIP server.

void ethernet_getInterfacePort(unsigned int *id, struct Result *result, const int index, const unsigned char service)

Get the port of a TCPIP service on the device.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code and the requested value if successful.

  • index – The index of the entity in question.

  • service – The index of the service to get the port for.