Skip to content
Snippets Groups Projects
Select Git revision
  • koalo/bhi160-works-but-dirty
  • ch3/splashscreen
  • m
  • master default protected
  • rahix/simple_menu
  • ios-workarounds
  • koalo/wip/i2c-for-python
  • genofire/ble-rewrite
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • schneider/bsec
  • rahix/bma
  • rahix/bhi
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
26 results

svc_dis.c

Blame
  • Forked from card10 / firmware
    1657 commits behind the upstream repository.
    svc_dis.c 8.59 KiB
    /*************************************************************************************************/
    /*!
     *  \file   svc_dis.c
     *        
     *  \brief  Example Device Information Service implementation.
     *
     *          $Date: 2018-04-17 23:02:20 +0000 (Tue, 17 Apr 2018) $
     *          $Revision: 34673 $
     *  
     *  Copyright (c) 2011 Wicentric, Inc., all rights reserved.
     *  Wicentric confidential and proprietary.
     *
     *  IMPORTANT.  Your use of this file is governed by a Software License Agreement
     *  ("Agreement") that must be accepted in order to download or otherwise receive a
     *  copy of this file.  You may not use or copy this file for any purpose other than
     *  as described in the Agreement.  If you do not agree to all of the terms of the
     *  Agreement do not use this file and delete all copies in your possession or control;
     *  if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior
     *  to any use, copying or further distribution of this software.
     */
    /*************************************************************************************************/
    
    #include "wsf_types.h"
    #include "att_api.h"
    #include "wsf_trace.h"
    #include "util/bstream.h"
    #include "svc_dis.h"
    #include "svc_cfg.h"
    
    /**************************************************************************************************
      Macros
    **************************************************************************************************/
    
    /*! Characteristic read permissions */
    #ifndef DIS_SEC_PERMIT_READ
    #define DIS_SEC_PERMIT_READ SVC_SEC_PERMIT_READ
    #endif
    
    /**************************************************************************************************
     Service variables
    **************************************************************************************************/
    
    /* Device information service declaration */
    static const uint8_t disValSvc[] = {UINT16_TO_BYTES(ATT_UUID_DEVICE_INFO_SERVICE)};
    static const uint16_t disLenSvc = sizeof(disValSvc);
    
    /* Manufacturer name string characteristic */
    static const uint8_t disValMfrCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_MFR_HDL), UINT16_TO_BYTES(ATT_UUID_MANUFACTURER_NAME)};
    static const uint16_t disLenMfrCh = sizeof(disValMfrCh);
    
    /* Manufacturer name string */
    static const uint8_t disUuMfr[] = {UINT16_TO_BYTES(ATT_UUID_MANUFACTURER_NAME)};
    static const uint8_t disValMfr[] = "Maxim Integrated";
    static const uint16_t disLenMfr = sizeof(disValMfr) - 1;
    
    /* System ID characteristic */
    static const uint8_t disValSidCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_SID_HDL), UINT16_TO_BYTES(ATT_UUID_SYSTEM_ID)};
    static const uint16_t disLenSidCh = sizeof(disValSidCh);
    
    /* System ID */
    static const uint8_t disUuSid[] = {UINT16_TO_BYTES(ATT_UUID_SYSTEM_ID)};
    static uint8_t disValSid[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
    static const uint16_t disLenSid = sizeof(disValSid);    
    
    /* Model number string characteristic */
    static const uint8_t disValMnCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_MN_HDL), UINT16_TO_BYTES(ATT_UUID_MODEL_NUMBER)};
    static const uint16_t disLenMnCh = sizeof(disValMnCh);
    
    /* Model number string */
    static const uint8_t disUuMn[] = {UINT16_TO_BYTES(ATT_UUID_MODEL_NUMBER)};