TMGetAdapterSpec Overview Group

The TMGetAdapterSpec API call, copies information about the current port adapter on the 1-Wire network specified by 'session_handle' into the provided structure, “Specification” (see below). This is the same structure used in TMGetFamilySpec.

This structure returns information on the feature set of the 1-Wire adapter. See the TMEX API Overview for a list of adapters. The structure returns information on whether or not the adapter in question is capable of overdrive speeds, power delivery (strong pullup), EPROM programming, flexible speed timing, and performing a 1-Wire break (short to ground).

typedef struct {
unsigned short features[32];
char description[255];
} Specification;

(This is a packed structure on 1 byte boundaries)

Currently, only the first five unsigned short integers of the “features” array are defined as follows:

features[0] = overdrive
features[1] = strong pullup
features[2] = EPROM programming
features[3] = flexible speed
features[4] = 1-Wire break (short to ground)
features[5-31] are left for future expansion

description: An array of characters that contains 3 fields; part number, alternative part number and brief functional description. The fields are delimited by commas and the string is null terminated.

Note: Requires a successful call to TMSetup before the adapter specification can be ascertained.


short far pascal TMGetAdapterSpec(

long session_handle,            // session handle for the desired 1-Wire network
void far *state_buffer,         // state buffer provided for the 1-Wire network session
Specification far *AdapterSpec  // pointer to a Specification struct
);

For a description of the above types, see the TMEX Type Descriptions.

Parameters

session_handle

Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.

state_buffer

Specifies a pointer to a memory location that TMEX keeps all of the state information for the 1-Wire networks. This parameter is required by most TMEX API functions.

AdapterSpec

Specifies a Specification struct that returns information on whether or not the adapter in question is capable of overdrive speeds, power delivery (strong pullup), EPROM programming, flexible speed timing, and performing a 1-Wire break (short to ground).

Return Value

1 => adapter information is in struct 'AdapterSpec'

<0 => a FILE_OPERATIONS error has occurred

Code Example