<?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>Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35975/initializing-cycling-power-service-0x1818</link><description>Hello! 
 I am trying to implement the Cycling Power from https://devzone.nordicsemi.com/f/nordic-q-a/9169/cycling-power-service-0x1818 
 Please, could you show how we need to configure the service? This way is not working: memset(&amp;amp;cp_init, 0, sizeof(cp_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Jul 2018 09:40:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35975/initializing-cycling-power-service-0x1818" /><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/140496?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 09:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdb1a27b-d7c5-401d-94ed-36a7da72f274</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Now I am trying to change the value of power:&lt;/p&gt;
&lt;p&gt;cps_measurement.power_measurement = 1000;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;err_code = ble_cps_measurement_send(&amp;amp;m_cps, &amp;amp;cps_measurement);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;err_code_CPS = err_code;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(err_code != BLE_ERROR_NO_TX_PACKETS) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;APP_ERROR_HANDLER(err_code);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But an error jumps:&amp;nbsp; NRF_ERROR_INVALID_STATE&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I see that it is because if (p_cps-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID){ in ble_cps_measurement_send.&lt;/p&gt;
&lt;p&gt;I see that you initialize cps_init.evt_handler = NULL; in the init_services.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you undestand why it happens?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/139012?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 15:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8b7fd7f-1ef3-420a-b322-fb6ad8cb7b9e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Juan,&lt;/p&gt;
&lt;p&gt;I did not touch them. I only modified main.c and added few defines in ble_srv_common.h.&lt;/p&gt;
&lt;p&gt;I am home already, so I can attach you my whole project tomorrow if you think that will help you. I tested this on SDK 11.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/139000?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 14:35:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6d65240-e009-4434-9a52-126441e29c61</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello Aryan,&lt;/p&gt;
&lt;p&gt;Did you modify the files ble_cp?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138933?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 11:04:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5ceac79-07d2-46df-a189-8a291d493c69</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I just tried to run this code and the CP service does show up along with CSC&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bb4fcf2924924a25a83d6b5d1cb85196/pastedimage1530702225451v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138914?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 09:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbdbfb2e-60c8-4b82-95ef-6c46f0efc2db</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello Aryan,&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;But it doesn&amp;#39;t work. I can connect with device as Speed &amp;amp; Cadence but I can not see the Power Cycling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138885?ContentTypeID=1</link><pubDate>Wed, 04 Jul 2018 06:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98a10767-d76e-41a3-ace6-1fe25252276a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;in services init you call this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    ble_cps_init_t        cps_init;
    
    // Initialize Cycling Power Service module
    memset(&amp;amp;cps_init, 0, sizeof(cps_init));

    cps_init.evt_handler = NULL;
    cps_init.feature     = BLE_CPS_FEATURE_WHEEL_REV_BIT | BLE_CSCS_FEATURE_CRANK_REV_BIT |
                            BLE_CSCS_FEATURE_MULTIPLE_SENSORS_BIT;

    // Here the sec level for the Cycling Speed and Cadence Service can be changed/increased.
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cps_init.cp_meas_attr_md.cccd_write_perm);   // for the measurement characteristic, only the CCCD write permission can be set by the application, others are mandated by service specification
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cps_init.cp_feature_attr_md.read_perm);      // for the feature characteristic, only the read permission can be set by the application, others are mandated by service specification
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cps_init.cp_ctrlpt_attr_md.write_perm);      // for the SC control point characteristic, only the write permission and CCCD write can be set by the application, others are mandated by service specification
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cps_init.cp_ctrlpt_attr_md.cccd_write_perm); // for the SC control point characteristic, only the write permission and CCCD write can be set by the application, others are mandated by service specification
    
    cps_init.ctrplt_supported_functions    = BLE_SRV_SC_CTRLPT_CUM_VAL_OP_SUPPORTED
                                              |BLE_SRV_SC_CTRLPT_SENSOR_LOCATIONS_OP_SUPPORTED
                                              |BLE_SRV_SC_CTRLPT_START_CALIB_OP_SUPPORTED;
    cps_init.ctrlpt_evt_handler            = sc_ctrlpt_event_handler;
    cps_init.list_supported_locations      = supported_locations;
    cps_init.size_list_supported_locations = sizeof(supported_locations) / sizeof(ble_sensor_location_t);            
    
    sensor_location           = BLE_SENSOR_LOCATION_FRONT_WHEEL;                    // initializes the sensor location to add the sensor location characteristic.
    cps_init.sensor_location = &amp;amp;sensor_location;
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cps_init.cp_sensor_loc_attr_md.read_perm);    // for the sensor location characteristic, only the read permission can be set by the application, others are mendated by service specification

    err_code = ble_cps_init(&amp;amp;m_cps, &amp;amp;cps_init);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in ble_srv_common.h file you add below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BLE_UUID_CYCLING_POWER                                   0x1818     /**&amp;lt; Cycling Power UUID. */

#define BLE_UUID_CYCLING_POWER_MEASUREMENT_CHAR                  0x2A63     /**&amp;lt; Cycling Power Feature characteristic UUID. */
#define BLE_UUID_CYCLING_POWER_FEATURE_CHAR                      0x2A65     /**&amp;lt; Cycling Power Measurement characteristic UUID. */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I guess that should be enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138762?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 11:57:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7c7d767-641c-450f-a606-05284a69d016</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can get the example of Nordic --&amp;gt; ble_app_cscs with s132_nrf52_2.0.0-7.alpha_softdevice&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138655?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 06:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1246e687-28fb-4e67-8454-491b1ae06bdf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;the code does not compile with SDK15 and SDv6.0.0. Can you tell me which versions are you using so that i can give it a try&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138648?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 05:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0072531a-ecd2-4e67-a03b-49dfc27d7c53</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I am trying to initialize the service Power Cycling from the files of this link &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/9169/cycling-power-service-0x1818"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/9169/cycling-power-service-0x1818&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I get the CSC example from Nordic and I tried to initialize the service of Power Cycling from the files that I downloaded.&lt;br /&gt;That&amp;#39;s all&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Initializing Cycling Power Service 0x1818</title><link>https://devzone.nordicsemi.com/thread/138582?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 16:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00dee228-9633-4d8c-a047-e6dac2f7d5ca</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Juan,&lt;/p&gt;
&lt;p&gt;You said that the above mentioned code is not working. Can you describe more of what is not working and what is the meaning of this?&lt;/p&gt;
&lt;p&gt;It would be also nice if you attach more code snippet (possibly your project) so that we are able to reproduce the failures you are observing. That way it is faster and most likely that we will be able to find the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>