Skip to content

Commit

Permalink
Merge branch 'ARDIN-28-ANCS-example'
Browse files Browse the repository at this point in the history
  • Loading branch information
Skjerve committed Aug 29, 2014
2 parents 58b5012 + 96753db commit a5c325c
Show file tree
Hide file tree
Showing 14 changed files with 2,228 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Release notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#Release notes 0.9.4:

##Changes:
* Added limited ANCS template
* Removed sleep.h for !defined(__SAM3X8E__) && !defined(__PIC32MX__)
* Attempted to reduce RAM usage


#Release notes 0.9.3:

##Changes:
Expand Down
287 changes: 287 additions & 0 deletions libraries/BLE/examples/ble_ANCS_template/ANCS_setup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE AttributeServer>
<Profile Version="1.3">
<SetupId>1</SetupId>
<Device>nRF8001_Dx</Device>
<Service Type="local" PrimaryService="true">
<Name>TX Power</Name>
<Uuid>1804</Uuid>
<Characteristic>
<Name>TX Power Level</Name>
<Uuid>2a07</Uuid>
<DefaultValue>0</DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>1</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>false</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<SetPipe>true</SetPipe>
<AckIsAuto>true</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="local" PrimaryService="true">
<Name>Immediate Alert</Name>
<Uuid>1802</Uuid>
<Characteristic>
<Name>Alert Level</Name>
<Uuid>2a06</Uuid>
<DefaultValue></DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>1</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<WriteWithoutResponse>true</WriteWithoutResponse>
<Write>false</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<SetPipe>false</SetPipe>
<AckIsAuto>true</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="local" PrimaryService="true">
<Name>Link Loss Alert</Name>
<Uuid>1803</Uuid>
<Characteristic>
<Name>Alert Level</Name>
<Uuid>2a06</Uuid>
<DefaultValue>0</DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>1</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>true</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<SetPipe>false</SetPipe>
<AckIsAuto>true</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="local" PrimaryService="true">
<Name>Battery</Name>
<Uuid>180f</Uuid>
<Characteristic>
<Name>Battery Level</Name>
<Uuid>2a19</Uuid>
<DefaultValue>64</DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>1</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>false</Write>
<Notify>true</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<SetPipe>true</SetPipe>
<AckIsAuto>false</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="4" NameSpace="01" Unit="27AD"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="remote" PrimaryService="true">
<Name>Immediate Alert</Name>
<Uuid>1802</Uuid>
<Characteristic>
<Name>Alert Level</Name>
<Uuid>2a06</Uuid>
<DefaultValue>0</DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>1</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<Read>false</Read>
<WriteWithoutResponse>true</WriteWithoutResponse>
<Write>false</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<AckIsAuto>true</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="local" PrimaryService="true">
<Name>Device Information</Name>
<Uuid>180a</Uuid>
<Characteristic>
<Name>Hardware Revision String</Name>
<Uuid>2a27</Uuid>
<DefaultValue></DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>9</MaxDataLength>
<AttributeLenType>2</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>false</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<SetPipe>true</SetPipe>
<AckIsAuto>false</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="25" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Service Type="remote" PrimaryService="true">
<Name>ANCS</Name>
<Uuid BaseUUID="79050000B5CE4E99A40F4B1E122D00D0" BaseUUIDName="ANCS">f431</Uuid>
<Characteristic>
<Name>Notification Source</Name>
<Uuid BaseUUID="9fbf0000630142d98c5825e699A21DBD" BaseUUIDName="ANCS Notification Source">120d</Uuid>
<DefaultValue></DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>20</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<Read>false</Read>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>false</Write>
<Notify>true</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<AckIsAuto>false</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
<Characteristic>
<Name>Control Point</Name>
<Uuid BaseUUID="69D1000045E149A898219BBDFDAAD9D9" BaseUUIDName="ANCS Control Point">d8f3</Uuid>
<DefaultValue></DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>20</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<Read>false</Read>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>true</Write>
<Notify>false</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<AckIsAuto>false</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
<Characteristic>
<Name>Data Source</Name>
<Uuid BaseUUID="22EA000024D64BB5BE44B36ACE7C7BFB" BaseUUIDName="ANCS Data Source">c6e9</Uuid>
<DefaultValue></DefaultValue>
<UsePresentationFormat>0</UsePresentationFormat>
<MaxDataLength>20</MaxDataLength>
<AttributeLenType>1</AttributeLenType>
<ForceOpen>false</ForceOpen>
<Properties>
<Read>false</Read>
<WriteWithoutResponse>false</WriteWithoutResponse>
<Write>false</Write>
<Notify>true</Notify>
<Indicate>false</Indicate>
<Broadcast>false</Broadcast>
</Properties>
<AckIsAuto>false</AckIsAuto>
<PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
<PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
<PeriodForProperties/>
</Characteristic>
</Service>
<Gapsettings>
<Name>ANCS Rusk</Name>
<DeviceNameWriteLength>0</DeviceNameWriteLength>
<LocalPipeOnDeviceName>false</LocalPipeOnDeviceName>
<DeviceNameShortLength>3</DeviceNameShortLength>
<Apperance>0240</Apperance>
<SecurityLevel>1</SecurityLevel>
<AuthenticationReq>0</AuthenticationReq>
<IoCapabilities>0</IoCapabilities>
<BondTimeout>600</BondTimeout>
<SecurityRequestDelay>99</SecurityRequestDelay>
<MinimumKeySize>7</MinimumKeySize>
<MaximumKeySize>16</MaximumKeySize>
<AdvertisingDataBondedBitmap>10</AdvertisingDataBondedBitmap>
<AdvertisingDataGeneralBitmap>10</AdvertisingDataGeneralBitmap>
<AdvertisingDataBrodcastBitmap>0</AdvertisingDataBrodcastBitmap>
<AdvertisingDataBondedScanResponseBitmap>2c40</AdvertisingDataBondedScanResponseBitmap>
<AdvertisingDataGeneralScanResponseBitmap>2c40</AdvertisingDataGeneralScanResponseBitmap>
<AdvertisingDataBrodcastScanResponseBitmap>0</AdvertisingDataBrodcastScanResponseBitmap>
<AdvertisingDataBondedBitmapCustom>1</AdvertisingDataBondedBitmapCustom>
<AdvertisingDataGeneralBitmapCustom>1</AdvertisingDataGeneralBitmapCustom>
<AdvertisingDataBrodcastBitmapCustom>0</AdvertisingDataBrodcastBitmapCustom>
<AdvertisingDataBondedScanResponseBitmapCustom>0</AdvertisingDataBondedScanResponseBitmapCustom>
<AdvertisingDataGeneralScanResponseBitmapCustom>0</AdvertisingDataGeneralScanResponseBitmapCustom>
<AdvertisingDataBrodcastScanResponseBitmapCustom>0</AdvertisingDataBrodcastScanResponseBitmapCustom>
<TxPowerLevelOffset>0</TxPowerLevelOffset>
<MinimumConnectionInterval>400</MinimumConnectionInterval>
<MaximumConnectionInterval>800</MaximumConnectionInterval>
<SlaveLatency>0</SlaveLatency>
<TimeoutMultipler>600</TimeoutMultipler>
<AddServiceUpdateCharacteristic>true</AddServiceUpdateCharacteristic>
<AddServiceUpdateCharacteristicPipe>true</AddServiceUpdateCharacteristicPipe>
<SercieToSolicitate>
<Uuid BaseUUID="79050000B5CE4E99A40F4B1E122D00D0" BaseUUIDName="ANCS">f431</Uuid>
</SercieToSolicitate>
<CustomAdTypes>
<AdType index="1">
<Type>19</Type>
<Value>4002</Value>
</AdType>
<AdType index="2">
<Type>18</Type>
<Value></Value>
</AdType>
</CustomAdTypes>
</Gapsettings>
<Hardwaresettings>
<Clocksource>1</Clocksource>
<ClockAccuracy>1</ClockAccuracy>
<InitialTxPower>3</InitialTxPower>
<HfClkSource>0</HfClkSource>
<DcDcConverter>0</DcDcConverter>
<ActiveSignalModeIndex>0</ActiveSignalModeIndex>
<ActiveSignalToTickDistance>0</ActiveSignalToTickDistance>
<DynamicWindowLimitingEnabled>true</DynamicWindowLimitingEnabled>
</Hardwaresettings>
<CurrentInput>
<BatteryCharge>220</BatteryCharge>
<Master32KhzClockAccuracy>10</Master32KhzClockAccuracy>
<ConnectionInterval>1000</ConnectionInterval>
<PercentOfTimeSleeping>0</PercentOfTimeSleeping>
<PercentOfTimeAdvertising>0</PercentOfTimeAdvertising>
<AdvertisingInterval>1280</AdvertisingInterval>
</CurrentInput>
</Profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright (c) 2014, Nordic Semiconductor ASA
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/* Attention!
* To maintain compliance with Nordic Semiconductor ASA's Bluetooth profile
* qualification listings, this section of source code must not be modified.
*/

#ifndef ALERT_LEVEL_CHARACTERISTIC_H
#define ALERT_LEVEL_CHARACTERISTIC_H

/** @file
* @brief
*/

/** @defgroup alert_level_characteristic alert_level_characteristic
* @{
* @ingroup services
*
* @brief alert_level_characteristic : defines possibles alert levels.
*
*/

/** Possible Alert Levels*/
typedef enum alert_level_t
{
/** No alert*/
ALERT_LEVEL_NO_ALERT = 0,
/** Mild/moderate alert*/
ALERT_LEVEL_MILD_ALERT = 1,
/** high alert*/
ALERT_LEVEL_HIGH_ALERT = 2,
}alert_level_t;

/** @} */

#endif // ALERT_LEVEL_CHARACTERISTIC_H
Loading

0 comments on commit a5c325c

Please sign in to comment.