<?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>AN36 charcteristics clarification</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/928/an36-charcteristics-clarification</link><description>attr_char_value.p_uuid = &amp;amp;ble_uuid;
 attr_char_value.p_attr_md = &amp;amp;attr_md;
 attr_char_value.init_len = sizeof(uint8_t);
 attr_char_value.init_offs = 0;
 attr_char_value.max_len = sizeof(uint8_t);
 attr_char_value.p_value = NULL;

 
 This is original</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Nov 2013 15:35:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/928/an36-charcteristics-clarification" /><item><title>RE: AN36 charcteristics clarification</title><link>https://devzone.nordicsemi.com/thread/4459?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2013 15:35:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:801be997-a7aa-416e-9370-e05f60156569</guid><dc:creator>michurin</dc:creator><description>&lt;p&gt;&amp;quot;... it makes more sense to use a uint8_t directly&amp;quot;
Disagree.
If the characteristic is commonly known/used that it has been already defined/templated. If not than it is proprietary anyways and as you&amp;#39;ve said &amp;quot;For your own applications, you can define this in any way you want&amp;quot;. Using customized type via shared .h file is as a good common practice.&lt;br /&gt;
I did also suggest a compromise:&lt;br /&gt;
typedef uint8_t led_state_t;
which do not change anything but do indeed make code nicer and which is more important readable and understandable.
Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AN36 charcteristics clarification</title><link>https://devzone.nordicsemi.com/thread/4458?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2013 14:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fed81630-caa4-4c3b-bf97-7c9a83c47342</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;This would most definitely be possible, and I agree that it makes the code look nicer.&lt;/p&gt;
&lt;p&gt;However, remember that the value actually used must be the same as the peer device uses. What you&amp;#39;re actually defining here is what value the peer device have to send over the air to set the LED, and hence I&amp;#39;d say that it makes more sense to use a uint8_t directly instead of an enum or a bool, since that makes it explicit what size value you should send from the Central device to this characteristic.&lt;/p&gt;
&lt;p&gt;For your own applications, you can define this in any way you want.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>