Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: USBDevice
Fork of HSP_Release by
This is an example program for the MAX32620HSP (MAXREFDES100 Health Sensor Platform). It demonstrates all the features of the platform and works with a companion graphical user interface (GUI) to help evaluate/configure/monitor the board. Go to the MAXREFDES100 product page and click on "design resources" to download the companion software. The GUI connects to the board through an RPC interface on a virtual serial port over the USB interface.
The RPC interface provides access to all the features of the board and is available to interface with other development environments such Matlab. This firmware provides realtime data streaming through the RPC interface over USB, and also provides the ability to log the data to flash for untethered battery operation. The data logging settings are configured through the GUI, and the GUI also provides the interface to download logged data.
Details on the RPC interface can be found here: HSP RPC Interface Documentation
Windows
With this program loaded, the MAX32620HSP will appear on your computer as a serial port. On Mac and Linux, this will happen by default. For Windows, you need to install a driver: HSP serial port windows driver
For more details about this platform and how to use it, see the MAXREFDES100 product page.
Diff: HSP/RpcServer/RpcServer.cpp
- Revision:
- 1:9490836294ea
- Parent:
- 0:e4a10ed6eb92
- Child:
- 3:8e9b9f5818aa
diff -r e4a10ed6eb92 -r 9490836294ea HSP/RpcServer/RpcServer.cpp
--- a/HSP/RpcServer/RpcServer.cpp Tue Oct 25 15:22:11 2016 +0000
+++ b/HSP/RpcServer/RpcServer.cpp Fri Apr 21 12:12:30 2017 -0500
@@ -49,7 +49,7 @@
#include "Device_Logging.h"
/// define the version string that is reported with a RPC "ReadVer" command
-#define FW_VERSION_STRING "HSP FW Version 3.0.0 10/14/16"
+#define FW_VERSION_STRING "HSP FW Version 3.0.1 4/21/16"
char args[32][32];
char results[32][32];
@@ -94,7 +94,7 @@
//******************************************************************************
int System_SystemCoreClock(char argStrs[32][32], char replyStrs[32][32]) {
- sprintf(replyStrs[0], "SystemCoreClock = %d", SystemCoreClock);
+ sprintf(replyStrs[0], "SystemCoreClock = %d", (unsigned int)SystemCoreClock);
strcpy(replyStrs[1], "\0");
return 0;
}
@@ -283,7 +283,7 @@
}
//******************************************************************************
-int CheckForDoubleQuote(char *str) {
+int CheckForDoubleQuote(const char *str) {
int doubleQuoteFound;
// scan through arguments, see if there is a double quote for a string
// argument
@@ -299,7 +299,7 @@
}
//******************************************************************************
-void ExtractDoubleQuoteStr(char *src, char *dst) {
+void ExtractDoubleQuoteStr(const char *src, char *dst) {
int start;
dst[0] = 0;
@@ -328,7 +328,7 @@
void RPC_call_test(void) {
int doubleQuoteFound;
char doubleQuoteStr[64];
- char *request = "/Logging/AppendMissionCmd \"BMP280 InitStart 1\"";
+ const char *request = "/Logging/AppendMissionCmd \"BMP280 InitStart 1\"";
// scan through arguments, see if there is a double quote for a string
// argument
@@ -351,6 +351,7 @@
int resultIndex;
int doubleQuoteFound;
struct RPC_registeredProcedure *procedurePtr;
+ int callResult;
// clear out the reply
reply[0] = 0;
@@ -410,10 +411,11 @@
strcpy(objectName, MAX30001_NAME);
}
+ callResult = 0;
procedurePtr = RPC_lookup(objectName, methodName);
if (procedurePtr != NULL) {
// printf("RPC_call: %s processing\n",requestCpy);
- procedurePtr->func(args, results);
+ callResult = procedurePtr->func(args, results);
} else {
printf("RPC_call: %s not found\n", requestCpy);
// printf("Unable to lookup %s %s", objectName, methodName);
@@ -422,11 +424,13 @@
// loop while (if) there are results to return
resultIndex = 0;
strcpy(reply, "\0");
- while (results[resultIndex][0] != '\0') {
- strcat(reply, results[resultIndex++]);
- strcat(reply, " ");
+ if (callResult != RPC_SKIP_CRLF) {
+ while (results[resultIndex][0] != '\0') {
+ strcat(reply, results[resultIndex++]);
+ strcat(reply, " ");
+ }
+ strcat(reply, "\r\n");
}
- strcat(reply, "\r\n");
}
//******************************************************************************
