IDBLUE logo
Static Public Member Functions
IDBlue Class Reference

Static Public Member Functions

(void) + enableDebugLog:
(BOOL) + debugLogEnabled
(int) + toAsciiByteArray:withData:withMaxLen:
(NSString *) + getStringFromAscii:withLen:
(NSString *) + getHexString:withDataLen:
(NSString *) + getHexStringReversed:withDataLen:
(NSString *) + getHexStringReversed:withDataLen:withIndex:withCount:
(int) + getTagIdBytes:withDest:withLen:
(void) + reverseByteArray:withLen:
(BOOL) + isNumeric:
(BOOL) + compareArrays:withLen1:withArray2:withLen2:
(ushort) + makeWord:
(ushort) + makeWord:withLow:
(void) + getWord:withHigh:withLow:
(void) + getDoubleWord:withDest:
(uint) + makeDoubleWord:
(byte) + computeChecksum:withCount:
(BOOL) + isValidCommand:
(NSString *) + convertCommandToString:
(NSString *) + convertPropertyToString:
(NSString *) + convertCommandStatusToString:
(NSString *) + convertConnectedModeToString:
(NSString *) + convertDisconnectedModeToString:

Detailed Description

IDBlue should not be instantiated. It only contains static methods


Member Function Documentation

+ (BOOL) compareArrays: (byte*)  array1
withLen1: (int)  len1
withArray2: (byte*)  array2
withLen2: (int)  len2 

Check if the 2 byte arrays contain the same data.

Parameters:
array1
len1
array2
len2
Returns:
TRUE if the arrays are the same length and contains the same data (or are both nil). Otherwise, returns FALSE.
+ (byte) computeChecksum: (byte*)  data
withCount: (int)  count 

Compute the checksum of count bytes in the given array (starting at index 0). The checksum is computed by XOR'ing all the bytes.

Parameters:
dataThe byte array to compute the checksum for
countThe number of bytes to be included in the checksum
Returns:
The XOR of all the bytes (i.e. the checksum)
+ (NSString *) convertCommandStatusToString: (CommandStatus)  status

Gets command status name from the given command status identifier.

Parameters:
statusthe command status identifier of the command status to get the name of
Returns:
the name of the command status, if the command status is valid, otherwise the hex value of the specified command status identifier.
+ (NSString *) convertCommandToString: (CommandIdentifier)  cmd

Get command name from the given command identifier

Parameters:
cmdThe command identifier of the command to get the name of
Returns:
the name of the command, if the command is valid, otherwise the hex value of the specified command identifier.
+ (NSString *) convertConnectedModeToString: (ConnectedMode)  mode

Get the connected mode name from the given ConnectedMode enumeration value

Parameters:
modeThe ConnectedMode to get the name of
Returns:
The name of the ConnectedMode
+ (NSString *) convertDisconnectedModeToString: (DisconnectedMode)  mode

Get the disconnected mode name from the given DisconnectedMode enumeration value

Parameters:
modeThe DisconnectedMode to get the name of
Returns:
The name of the DisconnectedMode
+ (NSString *) convertPropertyToString: (PropertyIdentifier)  property

Get property name from the given property identifier

Parameters:
propertyThe property identifier of the property to get the name of
Returns:
the name of the property, if the property is valid, otherwise the hex value of the specified property identifier.
+ (BOOL) debugLogEnabled

Get whether logging is enabled in the IDBLUE iOS SDK

+ (void) enableDebugLog: (BOOL)  enabled

Enable or disable logging inside the IDBLUE iOS SDK

Parameters:
enabledWhether logging is to be enabled or disabled
+ (NSString *) getHexString: (byte*)  data
withDataLen: (int)  dataLen 

Convert an array of bytes into hex values in string format

Parameters:
datathe array of bytes to be converted
dataLenthe number of bytes to convert
Returns:
an NSString object containing the hex values of all the bytes, separated by spaces. Returns nil if data is nil or dataLen <= 0
+ (NSString *) getHexStringReversed: (byte*)  data
withDataLen: (int)  dataLen 

Convert an array of bytes into a tag id string. The byte array is traversed in reverse order, and each byte is converted to a 2 character hex string and appended to the end of the tag id string.

Parameters:
dataThe byte array to convert to a tag id.
dataLenThe number of bytes to convert
Returns:
An NSString object containing the tag id if data is not nil and dataLen > 0, otherwise nil is returned.
+ (NSString *) getHexStringReversed: (byte*)  data
withDataLen: (int)  dataLen
withIndex: (int)  index
withCount: (int)  count 

Convert a partial array of bytes into a tag id string. The byte array is traversed in reverse order, and each byte is converted to a 2 character hex string and appended to the end of the tag id string.

Parameters:
dataThe byte array to convert to a tag id
dataLenThe number of bytes stored in the byte array
indexThe index in the byte array to start copying from
countThe number of characters to convert
Returns:
An NSString object containing the tag id if data is not nil, dataLen > 0, and index / count form a sub array that is completely contained in the given array, otherwise nil is returned.
+ (NSString *) getStringFromAscii: (byte*)  data
withLen: (int)  len 

Convert a byte array of ascii characters into an NSString object

Parameters:
datathe byte array to copy from
lenthe number of bytes to copy
Returns:
An NSString object containing the specified ascii characters if data is not nil and len > 0. Otherwise, nil is returned.
+ (int) getTagIdBytes: (NSString*)  tagId
withDest: (byte*)  dest
withLen: (int)  len 

Convert a tag id string into a byte array.

Parameters:
tagIdthe tag id string to convert to a byte array. It should be of even length and every 2 characters represents a single byte of data in hex.
destthe byte array that will receive the converted data.
lenthe length of the byte array
Returns:
the number of bytes copied
Remarks:
The byte array will be in reverse order of the bytes in the tag id string.
+ (void) getWord: (ushort)  word
withHigh: (byte*)  high
withLow: (byte*)  low 

The reverse of makeWord. Get the high byte and low byte from the given word, and copy them into the specified locations.

Parameters:
wordthe word to get
highlocation of the high byte
lowlocation of the low byte
+ (BOOL) isNumeric: (NSString*)  s

Determines if the given string contains all numeric values

Parameters:
sThe string to check for numeric
Returns:
TRUE if the given string has all numeric characters, FALSE otherwise. If the string is nil or empty, FALSE is returned.
+ (BOOL) isValidCommand: (int)  cmd

Determine if the given command header is a valid IDBLUE command header (i.e. it is contained in the CommandIdentifier enumeration).

Parameters:
cmdthe byte header to check
Returns:
TRUE if the given header is a valid IDBLUE command, FALSE otherwise.
+ (ushort) makeWord: (byte*)  highAndLow

Converts a high byte and a low byte into a word (ushort).

Parameters:
highAndLowbyte array containing 2 bytes (high and low)
Returns:
The ushort value formed by left shifting the high byte 8 bits to the left, then oring the low byte.
+ (ushort) makeWord: (byte)  high
withLow: (byte)  low 

Converts a high byte and a low byte into a word (ushort).

Parameters:
highthe high byte
lowthe low byte
Returns:
The ushort value formed by left shifting the high byte 8 bits to the left, then oring the low byte.
+ (int) toAsciiByteArray: (NSString*)  s
withData: (byte*)  data
withMaxLen: (int)  maxLen 

Convert an NSString object into an array of (ascii character) bytes.

Parameters:
sthe string to be converted
datapointer to the byte array to receive the ascii bytes
maxLenthe maximum number of bytes that can be put into the buffer (i.e. the length of the byte array).
Returns:
the number of ascii characters copied into the byte array.

The documentation for this class was generated from the following files:

 

Generated on Mon Jan 19 2015 15:47:39
Copyright © 2015 Cathexis Innovations Inc. All Rights Reserved.