<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>alert notification - field &amp;quot;category&amp;quot; shall have variable size</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15693/alert-notification---field-category-shall-have-variable-size</link><description>Hello,
Ble spec says that &amp;quot;new alert&amp;quot; characteristic - field: &amp;quot;category ID&amp;quot; can have 1 or 2 bytes.
 here 
 But it seems in your struct you let it have only 1B. 
 typedef struct
{
 uint8_t alert_category; /**&amp;lt; Alert category to which this alert belongs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Aug 2016 07:10:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15693/alert-notification---field-category-shall-have-variable-size" /><item><title>RE: alert notification - field "category" shall have variable size</title><link>https://devzone.nordicsemi.com/thread/59933?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2016 07:10:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f0421a3-38cc-469a-9478-68b14f447140</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Right you are. There&amp;#39;s another optional 1 byte bitmask in the &amp;quot;alert_category&amp;quot;, which we have not added to the profile. I&amp;#39;ll report this internally as a feature-request.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;And when you assign ANS client data
during notification event you expect
fixed size 1B:&lt;/p&gt;
&lt;p&gt;p_alert-&amp;gt;alert_category_count =
p_notification-&amp;gt;data[1];&lt;br /&gt;
//lint !e415&lt;/p&gt;
&lt;p&gt;it might be actually bug because
server might use 2B for &amp;quot;category&amp;quot; -
thus offset for &amp;quot;count&amp;quot; can be 2.
Right? I&amp;#39;m new to BLE so I&amp;#39;m not
sure...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This shall point to the correct member of the struct. I&amp;#39;ll classify this as an improvement internally.&lt;/p&gt;
&lt;p&gt;Thanks for reporting this to us! It&amp;#39;s highly appreciated that you help us improve the SDK.&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>