ota_app_service.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**************************************************************************************************
  2. Phyplus Microelectronics Limited confidential and proprietary.
  3. All rights reserved.
  4. IMPORTANT: All rights of this software belong to Phyplus Microelectronics
  5. Limited ("Phyplus"). Your use of this Software is limited to those
  6. specific rights granted under the terms of the business contract, the
  7. confidential agreement, the non-disclosure agreement and any other forms
  8. of agreements as a customer or a partner of Phyplus. You may not use this
  9. Software unless you agree to abide by the terms of these agreements.
  10. You acknowledge that the Software may not be modified, copied,
  11. distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy
  12. (BLE) integrated circuit, either as a product or is integrated into your
  13. products. Other than for the aforementioned purposes, you may not use,
  14. reproduce, copy, prepare derivative works of, modify, distribute, perform,
  15. display or sell this Software and/or its documentation for any purposes.
  16. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  17. PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  18. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  19. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  20. PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  21. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  22. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  23. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  24. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  25. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  26. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  27. **************************************************************************************************/
  28. #ifndef _OTA_APP_SERVICE_H
  29. #define _OTA_APP_SERVICE_H
  30. #include "bcomdef.h"
  31. enum{
  32. OTA_MODE_OTA_APPLICATION= 0,
  33. OTA_MODE_OTA_FCT,// 1
  34. OTA_MODE_OTA,// 2
  35. OTA_MODE_RESOURCE,// 3
  36. OTA_MODE_OTA_NADDR = 6// 6 ota no address plus
  37. };
  38. #define OTA_MODE_SELECT_REG 0x4000f034
  39. #define OTA_APP_SERVICE_VERSION "V2.0.1"
  40. enum{
  41. OTAAPP_CMD_START_OTA = 1,
  42. OTAAPP_CMD_INFO,
  43. OTAAPP_CMD_FORMAT,
  44. OTAAPP_CMD_VER,
  45. };
  46. typedef struct{
  47. uint8_t cmd;
  48. union{
  49. struct{
  50. uint8_t reserv[20-1];
  51. } dummy;
  52. struct{
  53. uint8_t mode;
  54. } start;
  55. } p; //parameter
  56. }ota_app_cmd_t;
  57. bStatus_t ota_app_AddService(void);
  58. int ota_vendor_module_StartOTA(uint8_t mode);
  59. int ota_vendor_module_Version( uint8_t* major, uint8_t* minor, uint8_t* revision, uint8_t *test_build);
  60. #endif