ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.63k stars 2.96k forks source link

Cellular Information #11083

Closed JRubis closed 4 years ago

JRubis commented 4 years ago

Description

Hi, I have noticed some inconsistencies in the data returned when using Cellular Information. The correct data is returned, however, in most cases, the AT command that was used to query the module is prepended and in another, it isn't. In addition, get_serial_number() also prepends "RDY" Likewise get_manufacture() prepends a \r. Is there a reason for this? I would have expected these methods to return the value of the parameter without the AT command prepended. get_iccid() is the only method that appears to do this.

get_serial_number returns: "RDY\r\nAT+CGSN\r\r\n866429030121264\r\n\r\n" get_manufacturer returns: "\rAT+CGMI\r\r\nQuectel\r\n\r\n" get_model returns: "AT+CGMM\r\r\nBG96\r\n\r\n"
get_revision returns: "AT+CGMR\r\r\nBG96MAR02A07M1G\r\n\r\n" get_imsi returns: "AT+CIMI\r\r\n31041"
get_iccid returns: "89015104272289721398"

Issue request type

[x] Question
[ ] Enhancement
[ ] Bug
AriParkkila commented 4 years ago

@JRubis You need to call QUECTEL_BG96::init before any other Cellular APIs like CellularInformation. Also CellularStateMachine calls init at NetworkInterface::connect().

0xc0170 commented 4 years ago

@JRubis You need to call QUECTEL_BG96::init before any other Cellular APIs like CellularInformation. Also CellularStateMachine calls init at NetworkInterface::connect().

@JRubis Does that answer your question?

JRubis commented 4 years ago

Yes it seems to work Ok now. Thank you.