Getters and setters
CANopen_301 » OD interface

Getter and setter helper functions for accessing different types of Object Dictionary variables. More...

## Functions

ODR_t | OD_get_i8 (const OD_entry_t *entry, uint8_t subIndex, int8_t *val, bool_t odOrig)
| Get int8_t variable from Object Dictionary. More...
ODR_t | OD_get_i16 (const OD_entry_t *entry, uint8_t subIndex, int16_t *val, bool_t odOrig)
| Get int16_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_i32 (const OD_entry_t *entry, uint8_t subIndex, int32_t *val, bool_t odOrig)
| Get int32_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_i64 (const OD_entry_t *entry, uint8_t subIndex, int64_t *val, bool_t odOrig)
| Get int64_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_u8 (const OD_entry_t *entry, uint8_t subIndex, uint8_t *val, bool_t odOrig)
| Get uint8_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_u16 (const OD_entry_t *entry, uint8_t subIndex, uint16_t *val, bool_t odOrig)
| Get uint16_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_u32 (const OD_entry_t *entry, uint8_t subIndex, uint32_t *val, bool_t odOrig)
| Get uint32_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_u64 (const OD_entry_t *entry, uint8_t subIndex, uint64_t *val, bool_t odOrig)
| Get uint64_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_r32 (const OD_entry_t *entry, uint8_t subIndex, float32_t *val, bool_t odOrig)
| Get float32_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_get_r64 (const OD_entry_t *entry, uint8_t subIndex, float64_t *val, bool_t odOrig)
| Get float64_t variable from Object Dictionary, see OD_get_i8.
ODR_t | OD_set_i8 (const OD_entry_t *entry, uint8_t subIndex, int8_t val, bool_t odOrig)
| Set int8_t variable in Object Dictionary. More...
ODR_t | OD_set_i16 (const OD_entry_t *entry, uint8_t subIndex, int16_t val, bool_t odOrig)
| Set int16_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_i32 (const OD_entry_t *entry, uint8_t subIndex, int32_t val, bool_t odOrig)
| Set int16_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_i64 (const OD_entry_t *entry, uint8_t subIndex, int64_t val, bool_t odOrig)
| Set int16_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_u8 (const OD_entry_t *entry, uint8_t subIndex, uint8_t val, bool_t odOrig)
| Set uint8_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_u16 (const OD_entry_t *entry, uint8_t subIndex, uint16_t val, bool_t odOrig)
| Set uint16_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_u32 (const OD_entry_t *entry, uint8_t subIndex, uint32_t val, bool_t odOrig)
| Set uint32_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_u64 (const OD_entry_t *entry, uint8_t subIndex, uint64_t val, bool_t odOrig)
| Set uint64_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_r32 (const OD_entry_t *entry, uint8_t subIndex, float32_t val, bool_t odOrig)
| Set float32_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_set_r64 (const OD_entry_t *entry, uint8_t subIndex, float64_t val, bool_t odOrig)
| Set float64_t variable in Object Dictionary, see OD_set_i8.
ODR_t | OD_getPtr_i8 (const OD_entry_t *entry, uint8_t subIndex, int8_t **val)
| Get pointer to int8_t variable from Object Dictionary. More...
ODR_t | OD_getPtr_i16 (const OD_entry_t *entry, uint8_t subIndex, int16_t **val)
| Get pointer to int16_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_i32 (const OD_entry_t *entry, uint8_t subIndex, int32_t **val)
| Get pointer to int32_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_i64 (const OD_entry_t *entry, uint8_t subIndex, int64_t **val)
| Get pointer to int64_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_u8 (const OD_entry_t *entry, uint8_t subIndex, uint8_t **val)
| Get pointer to uint8_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_u16 (const OD_entry_t *entry, uint8_t subIndex, uint16_t **val)
| Get pointer to uint16_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_u32 (const OD_entry_t *entry, uint8_t subIndex, uint32_t **val)
| Get pointer to uint32_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_u64 (const OD_entry_t *entry, uint8_t subIndex, uint64_t **val)
| Get pointer to uint64_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_r32 (const OD_entry_t *entry, uint8_t subIndex, float32_t **val)
| Get pointer to float32_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_r64 (const OD_entry_t *entry, uint8_t subIndex, float64_t **val)
| Get pointer to float64_t variable from OD, see OD_getPtr_i8.
ODR_t | OD_getPtr_vs (const OD_entry_t *entry, uint8_t subIndex, char **val, OD_size_t *dataLength)
| Get pointer to "visible string" variable from Object Dictionary. More...
ODR_t | OD_getPtr_os (const OD_entry_t *entry, uint8_t subIndex, uint8_t **val, OD_size_t *dataLength)
| Get pointer to "octet string" variable from OD, see OD_getPtr_vs.
ODR_t | OD_getPtr_us (const OD_entry_t *entry, uint8_t subIndex, uint16_t **val, OD_size_t *dataLength)
| Get pointer to "unicode string" variable from OD, see OD_getPtr_vs.

## Detailed Description

Getter and setter helper functions for accessing different types of Object Dictionary variables.

## Function Documentation

## OD_get_i8()

ODR_t OD_get_i8 | ( | const OD_entry_t * | entry,
|  | uint8_t | subIndex,
|  | int8_t * | val,
|  | bool_t | odOrig
| ) |  |

Get int8_t variable from Object Dictionary.

Parameters

  | entry | OD entry returned by OD_find().
  | subIndex | Sub-index of the variable from the OD object.
  [out] | val | Value will be written here.
  | odOrig | If true, then potential IO extension on entry will be ignored and data in the original OD location will be returned.

Returns
  Value from ODR_t, "ODR_OK" in case of success. Error, if variable does not exist in object dictionary or it does not have the correct length or other reason.

## OD_set_i8()

ODR_t OD_set_i8 | ( | const OD_entry_t * | entry,
|  | uint8_t | subIndex,
|  | int8_t | val,
|  | bool_t | odOrig
| ) |  |

Set int8_t variable in Object Dictionary.

Parameters

  entry | OD entry returned by OD_find().
  subIndex | Sub-index of the variable from the OD object.
  val | Value to write.
  odOrig | If true, then potential IO extension on entry will be ignored and data in the original OD location will be written.

Returns
  Value from ODR_t, "ODR_OK" in case of success. Error, if variable does not exist in object dictionary or it does not have the correct length or other reason.

## OD_getPtr_i8()

ODR_t OD_getPtr_i8 | ( | const OD_entry_t * | entry,
|  | uint8_t | subIndex,
|  | int8_t ** | val
| ) |  |

Get pointer to int8_t variable from Object Dictionary.

Function always returns "dataObjectOriginal" pointer, which points to data in the original OD location. Take care, if IO extension is enabled on OD entry.

Parameters

  | entry | OD entry returned by OD_find().
  | subIndex | Sub-index of the variable from the OD object.
  [out] | val | Pointer to variable will be written here.

Returns
  Value from ODR_t, "ODR_OK" in case of success. Error, if variable does not exist in object dictionary or it does not have the correct length or other reason.

## OD_getPtr_vs()

ODR_t OD_getPtr_vs | ( | const OD_entry_t * | entry,
|  | uint8_t | subIndex,
|  | char ** | val,
|  | OD_size_t * | dataLength
| ) |  |

Get pointer to "visible string" variable from Object Dictionary.

Function always returns "dataObjectOriginal" pointer, which points to data in the original OD location. Take care, if IO extension is enabled on OD entry.

Parameters

  | entry | OD entry returned by OD_find().
  | subIndex | Sub-index of the variable from the OD object.
  [out] | val | Pointer to variable will be written here.
  [out] | dataLength | Total variable length will be written here, may be NULL.

Returns
  Value from ODR_t, "ODR_OK" in case of success. Error, if variable does not exist in object dictionary or it has zero length or other reason.