Aaron Silva
/
HSP_RPC_GUI
publishing
HSP/Devices/MAX30205/MAX30205_RPC.cpp@0:fd5a76956754, 2017-03-09 (annotated)
- Committer:
- asilva14
- Date:
- Thu Mar 09 23:54:04 2017 +0000
- Revision:
- 0:fd5a76956754
commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
asilva14 | 0:fd5a76956754 | 1 | /******************************************************************************* |
asilva14 | 0:fd5a76956754 | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
asilva14 | 0:fd5a76956754 | 3 | * |
asilva14 | 0:fd5a76956754 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
asilva14 | 0:fd5a76956754 | 5 | * copy of this software and associated documentation files (the "Software"), |
asilva14 | 0:fd5a76956754 | 6 | * to deal in the Software without restriction, including without limitation |
asilva14 | 0:fd5a76956754 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
asilva14 | 0:fd5a76956754 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
asilva14 | 0:fd5a76956754 | 9 | * Software is furnished to do so, subject to the following conditions: |
asilva14 | 0:fd5a76956754 | 10 | * |
asilva14 | 0:fd5a76956754 | 11 | * The above copyright notice and this permission notice shall be included |
asilva14 | 0:fd5a76956754 | 12 | * in all copies or substantial portions of the Software. |
asilva14 | 0:fd5a76956754 | 13 | * |
asilva14 | 0:fd5a76956754 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
asilva14 | 0:fd5a76956754 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
asilva14 | 0:fd5a76956754 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
asilva14 | 0:fd5a76956754 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
asilva14 | 0:fd5a76956754 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
asilva14 | 0:fd5a76956754 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
asilva14 | 0:fd5a76956754 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
asilva14 | 0:fd5a76956754 | 21 | * |
asilva14 | 0:fd5a76956754 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
asilva14 | 0:fd5a76956754 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
asilva14 | 0:fd5a76956754 | 24 | * Products, Inc. Branding Policy. |
asilva14 | 0:fd5a76956754 | 25 | * |
asilva14 | 0:fd5a76956754 | 26 | * The mere transfer of this software does not imply any licenses |
asilva14 | 0:fd5a76956754 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
asilva14 | 0:fd5a76956754 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
asilva14 | 0:fd5a76956754 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
asilva14 | 0:fd5a76956754 | 30 | * ownership rights. |
asilva14 | 0:fd5a76956754 | 31 | ******************************************************************************* |
asilva14 | 0:fd5a76956754 | 32 | */ |
asilva14 | 0:fd5a76956754 | 33 | #include "MAX30205_RPC.h" |
asilva14 | 0:fd5a76956754 | 34 | #include "StringHelper.h" |
asilva14 | 0:fd5a76956754 | 35 | #include "MAX30205.h" |
asilva14 | 0:fd5a76956754 | 36 | #include "Peripherals.h" |
asilva14 | 0:fd5a76956754 | 37 | #include "Device_Logging.h" |
asilva14 | 0:fd5a76956754 | 38 | #include "RpcServer.h" |
asilva14 | 0:fd5a76956754 | 39 | |
asilva14 | 0:fd5a76956754 | 40 | extern Device_Logging *bmp280_Logging; |
asilva14 | 0:fd5a76956754 | 41 | extern Device_Logging *MAX30205_0_Logging; |
asilva14 | 0:fd5a76956754 | 42 | extern Device_Logging *MAX30205_1_Logging; |
asilva14 | 0:fd5a76956754 | 43 | |
asilva14 | 0:fd5a76956754 | 44 | //****************************************************************************** |
asilva14 | 0:fd5a76956754 | 45 | int MAX30205_1_InitStart(char argStrs[32][32], char replyStrs[32][32]) { |
asilva14 | 0:fd5a76956754 | 46 | uint8_t args[1]; |
asilva14 | 0:fd5a76956754 | 47 | uint8_t reply[1]; |
asilva14 | 0:fd5a76956754 | 48 | ProcessArgs(argStrs, args, sizeof(args)); |
asilva14 | 0:fd5a76956754 | 49 | MAX30205_0_Logging->initStart(args[0]); |
asilva14 | 0:fd5a76956754 | 50 | reply[0] = 0x80; |
asilva14 | 0:fd5a76956754 | 51 | FormatReply(reply, sizeof(reply), replyStrs); |
asilva14 | 0:fd5a76956754 | 52 | return 0; |
asilva14 | 0:fd5a76956754 | 53 | } |
asilva14 | 0:fd5a76956754 | 54 | |
asilva14 | 0:fd5a76956754 | 55 | //****************************************************************************** |
asilva14 | 0:fd5a76956754 | 56 | int MAX30205_2_InitStart(char argStrs[32][32], char replyStrs[32][32]) { |
asilva14 | 0:fd5a76956754 | 57 | uint8_t args[1]; |
asilva14 | 0:fd5a76956754 | 58 | uint8_t reply[1]; |
asilva14 | 0:fd5a76956754 | 59 | ProcessArgs(argStrs, args, sizeof(args)); |
asilva14 | 0:fd5a76956754 | 60 | MAX30205_1_Logging->initStart(args[0]); |
asilva14 | 0:fd5a76956754 | 61 | reply[0] = 0x80; |
asilva14 | 0:fd5a76956754 | 62 | FormatReply(reply, sizeof(reply), replyStrs); |
asilva14 | 0:fd5a76956754 | 63 | return 0; |
asilva14 | 0:fd5a76956754 | 64 | } |