Movesense: how to determine wbcmd port on mac os x

时间:2018-09-18 19:28:38

标签: movesense

I've been digging around, but can't seem to find how to determine the proper port for a movesense device in the programming jig in order to use the wbcmd tool to query the device.

I've successfully used the jig to reflash devices, so that part is working. What I'm missing is how to determine the port option in wbcmd in order to successfully talk to the device on mac os X (currently: High Sierra).

I do see /dev/cu.usbserial-AIO4RYMP and /dev/tty.usbserial-AIO4RYMP, but using either of those as the --port option just returns "No device connected".

At this point, I am unsure if it's a wbcmd problem or a setup problem, but again, I can successfully flash a device with this setup on High Sierra no problem, and things look like they're configured correctly.

Thanks for any help

1 个答案:

答案 0 :(得分:1)

我不会深入探讨Mac串行端口的细节,但是简短的规则是/dev/tty.*用于传入(如getty),而/dev/cu.*用于传出通信,因此您应该使用{{ 1}}一。

请确保您已在App.cpp中定义了/dev/cu.*,并且请注意,启用串行通信会使nRF52的功耗增加几毫安。

编辑:我已纠正,看起来SERIAL_COMMUNICATION(true) -macro在最新版本中已过时。最好的方法是在其中使用WB API SERIAL_COMMUNICATION() -path和PUT system/settings/uarton。此设置已存储,仅需要执行一次,并且在下次重新启动时生效。

请参见Settings API YAML

应用程序的小型示例代码(true):

UartClient.cpp

标题(#include "movesense.h" #include "UartClient.hpp" #include "system_settings/resources.h" const char* const UartClient::LAUNCHABLE_NAME = "UART"; UartClient::UartClient() : ResourceClient(WBDEBUG_NAME(__FUNCTION__), WB_EXEC_CTX_APPLICATION), LaunchableModule(LAUNCHABLE_NAME, WB_EXEC_CTX_APPLICATION) { } UartClient::~UartClient() { } bool UartClient::initModule() { mModuleState = WB_RES::ModuleStateValues::INITIALIZED; return true; } void UartClient::deinitModule() { mModuleState = WB_RES::ModuleStateValues::UNINITIALIZED; } bool UartClient::startModule() { mModuleState = WB_RES::ModuleStateValues::STARTED; // Enable UART. Notice that the change takes effect on next reboot. ResourceClient::asyncPut(WB_RES::LOCAL::SYSTEM_SETTINGS_UARTON(), AsyncRequestOptions::Empty, true); return true; } void UartClient::stopModule() { mModuleState = WB_RES::ModuleStateValues::STOPPED; } ):

UartClient.hpp

或者,您可以使用iOS示例应用程序,还有一个选项可以在UI中启用UART。该更改还将在下次重新启动时生效。