TMOneWireCom Code Example

long session_handle;
short result;

/* session_handle set from a call to TMExtendedStartSession */
...

/* read the OneWireCom state */
result = TMOneWireCom(session_handle, 1, 0);

switch (result)
{
    case 0x00: printf(“Normal communication speed\n”); break;
    case 0x01: printf(“Overdrive communication speed\n”); break;
    case 0x02: printf(“Relaxed communication speed\n”); break;
    default: printf(“Error %d\n”); break;
};

/* close the session with a call to TMEndSession */
...