Skip to content

Custom comand. How to get string data from Descriptor or Response?  #13

@Igorsnaki

Description

@Igorsnaki

Hi all!

Thanks for a great OBD lib.
I just start investigate it and I have a question:

For example I want to get car temperature, using custom comand:

 obd.request(command: Command.Custom.digit(mode: 01, pid: 05)) { (descr) in
           if let response = descr?.response {
               print(response)
           } 
       }

In logs I recieve such data:

Write to OBD Optional("01 05\r")
Wrote 6 bytes
Read 10 bytes
Read 10 bytes
Read 2 bytes
Read complete
41 05 80
41 05 81

Using lib I receive descriptor:
from descriptor I can get Response.
What next steps???
How can I get such command : 41 05 80 ??

screen shot 2017-11-21 at 6 59 37 pm copy

desc?.gerResponse = nil

I can get only : desc.response
But : Response has interface:
public var strigDescriptor: String?
public static func ==(lhs: Response, rhs: Response) -> Bool
public var hasData: Bool { get }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions