Function

OBEXAddByteSequenceHeader(_:_:_:)

Add a byte sequence header to a dictionary of OBEXheaders.

Declaration

func OBEXAddByteSequenceHeader(_ inHeaderData: UnsafeRawPointer!, _ inHeaderDataLength: UInt32, _ dictRef: CFMutableDictionary!) -> OBEXError

Parameters

inHeaderData

bytes you want to put in the byte sequence header.

inHeaderDataLength

length of the bytes you want to put in the byte sequence header.

dictRef

dictionary you have allocated to hold the headers. Make sure it's mutable.

Return Value

Error code, kOBEXSuccess (0) if success.

Discussion

Byte Sequence header - OBEX Spec, 2.2.5: Byte sequence. One thing of important note here - since we don't know what Header Identifier and length you intend to use here, you MUST include your own identifier and length in the data you pass. Thus, your data must be in this format: <1:HI><2:LENGTH><n:(<TAG><LENGTH><VALUE>)> Also, note that LENGTH = (3 + n), (1 for HI, 2 for the 2 bytes of length information, plus your n bytes of custom data). Be careful here to not mess up these values, as it could adversely affect the ability of the remote-device's headers parser.

See Also

Miscellaneous

func OBEXAddApplicationParameterHeader(UnsafeRawPointer!, UInt32, CFMutableDictionary!) -> OBEXError

Add bytes representing an application parameter to a dictionary of OBEX headers.

func OBEXAddAuthorizationChallengeHeader(UnsafeRawPointer!, UInt32, CFMutableDictionary!) -> OBEXError

Add an authorization challenge header to a dictionary of OBEXheaders.

func OBEXAddAuthorizationResponseHeader(UnsafeRawPointer!, UInt32, CFMutableDictionary!) -> OBEXError

Add an authorization Response header to a dictionary of OBEXheaders.

func OBEXAddConnectionIDHeader(UnsafeRawPointer!, UInt32, CFMutableDictionary!) -> OBEXError

Add bytes representing a connection ID to a dictionary of OBEX headers.

func OBEXAddCountHeader(UInt32, CFMutableDictionary!) -> OBEXError

Add a CFStringRef to a dictionary of OBEXheaders.

func OBEXAddLengthHeader(UInt32, CFMutableDictionary!) -> OBEXError

Add a CFStringRef to a dictionary of OBEXheaders.

func OBEXAddNameHeader(CFString!, CFMutableDictionary!) -> OBEXError

Add a CFStringRef to a dictionary of OBEXheaders.

func OBEXAddTime4ByteHeader(UInt32, CFMutableDictionary!) -> OBEXError

Add a CFStringRef to a dictionary of OBEXheaders.

func OBEXAddTypeHeader(CFString!, CFMutableDictionary!) -> OBEXError

Add a CFStringRef to a dictionary of OBEXheaders.

func OBEXAddUserDefinedHeader(UnsafeRawPointer!, UInt32, CFMutableDictionary!) -> OBEXError

Add a user-defined custom header to a dictionary of OBEXheaders.

func OBEXGetHeaders(UnsafeRawPointer!, Int) -> CFDictionary!

Take a data blob and looks for OBEX headers.

func OBEXHeadersToBytes(CFDictionary!) -> Unmanaged<CFMutableData>!

Converts a dictionary of headers to a data pointer, from which you can extract as bytes and pass to the OBEX command/response functions.