<?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>s110/s120 send/receive data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5232/s110-s120-send-receive-data</link><description>Hello! Working with nrf51822 as s110/s120 device. Can anyone tell me, how can I receve/send data via Blue Tooth?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Jan 2015 14:05:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5232/s110-s120-send-receive-data" /><item><title>RE: s110/s120 send/receive data</title><link>https://devzone.nordicsemi.com/thread/18331?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2015 14:05:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af0042a2-d210-4c4f-b422-65c1299e9450</guid><dc:creator>Vebj&amp;#248;rn</dc:creator><description>&lt;p&gt;There is no general function like send(char * bytes, int length) as you say.
The nan-36 paper is good starting point to understanding how to transmit data between devices. When you have created a service with characteristics, you can perform five operations on the characteristics: write, write without response, read, notify, and indicate.&lt;/p&gt;
&lt;p&gt;For example, your s120 device can write data to a characteristic in your s110 device, or the s110 device can notify the s120 of a change in a characteristic.&lt;/p&gt;
&lt;p&gt;You can find examples of this in the SDK as John pointed out, or you can check out the documentation which lists all the functions you need.
Here you can read about the write function for example: &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/6.0.0/s120/html/a00534.html#ga90298b8dcd8bbe7bbe69d362d1133378"&gt;https://devzone.nordicsemi.com/documentation/nrf51/6.0.0/s120/html/a00534.html#ga90298b8dcd8bbe7bbe69d362d1133378&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want a function like send(char * bytes, int length), you would have to write it yourself. In the s120 device it would look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void send(uint8_t* bytes, int length){	

    ble_gattc_write_params_t write_params;

    write_params.write_op = BLE_GATT_OP_WRITE_REQ; 
    write_params.handle   = value_handle; // This needs to be the value handle of the char you want to write to
    write_params.offset   = 0;
    write_params.len      = length;
    write_params.p_value  = bytes;

    err_code = sd_ble_gattc_write(conn_handle, &amp;amp;write_params);
    //conn handle must be the connection handle to the device you want to  write to

}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: s110/s120 send/receive data</title><link>https://devzone.nordicsemi.com/thread/18330?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2015 13:41:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a114bac0-7f84-471d-9500-73576698e647</guid><dc:creator>bishop</dc:creator><description>&lt;p&gt;yes, where are many examples, but  I need multipurpose function like a send(char * bytes, int length) to send data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: s110/s120 send/receive data</title><link>https://devzone.nordicsemi.com/thread/18329?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2015 13:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8d43063-3521-4bee-a374-55eb35c24c78</guid><dc:creator>John</dc:creator><description>&lt;p&gt;If you haven&amp;#39;t already done so, you should download the SDK and peruse the examples. There are many examples of standard profiles implemented that send and receive data. For example, if you go to the following path in the SDK you can find a bunch of standard profile examples: nrf51_sdk_v6_0_0_43681\nrf51822\Board\nrf6310\s110&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: s110/s120 send/receive data</title><link>https://devzone.nordicsemi.com/thread/18328?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2015 13:19:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e4bbf35-e632-41a0-854c-cc90ac699e76</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;I have the same problem. How do the send/recieve function look like? In the n-AN36 its explained how to set up a service and characteristic but not how the code looks for sending/recieving....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>