Passing hex data rather than ASCII #177
-
I'm interfacing with a device that sends a stream of hex data (starts with 0x02, ends with 0x03). As far as I can tell, ORSSerialPort is configured for ASCII by default. Is there a way to configure for binary/hex ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi Denis, ORSSerialPort is not configured for ASCII by default. It deals with raw binary data, as represented by instances of |
Beta Was this translation helpful? Give feedback.
-
Thanks Andrew,
I was focused on the NSString references, rather than NSData. Should have
dug into the code.
Thanks for your explanation.
Denis
…On Wed, Jun 9, 2021 at 12:27 PM Andrew Madsen ***@***.***> wrote:
Hi Denis,
ORSSerialPort is not configured for ASCII by default. It deals with raw
binary data, as represented by instances of NSData (Data in Swift). There
are some convenience APIs in a couple places to make sending and receiving
strings easier, but they're optional to use and all have (NS)Data-based
counterparts. What exactly are you running into trouble with?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT65L5V5WOXD3XWS6PQY4QTTR66DDANCNFSM46LATPJQ>
.
|
Beta Was this translation helpful? Give feedback.
Hi Denis,
ORSSerialPort is not configured for ASCII by default. It deals with raw binary data, as represented by instances of
NSData
(Data
in Swift). There are some convenience APIs in a couple places to make sending and receiving strings easier, but they're optional to use and all have(NS)Data
-based counterparts. What exactly are you running into trouble with?