Commit Graph

1445 Commits

Author SHA1 Message Date
Johan Hedberg e3e91d3280 Bluetooth: Add name member to HCI driver struct
This is more of a convenience to let the driver identify itself in
debug logs and the monitor protocol.

Change-Id: I73351477e98d45d6344c180b8088bde29df6f7d9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Johan Hedberg 4488fc6cab Bluetooth: Move HCI device bus information to the driver
The bus that we notify over the monitor protocol is really driver
specific, so let each driver specify their bus type.

Change-Id: Ic3a086fcc06352dbf051e52cef5bf6b8696349ae
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Johan Hedberg 264c207f4f Bluetooth: Add custom "monitor" protocol logging over UART
With most boards there's no simple way to get access to the HCI
traffic. Simultaneously these boards only have one external UART for
the console. This patch introduces a protocol which combines both
normal logs and HCI logs over a single binary protocol sent over the
console UART.

The protocol is modeled based on the btsnoop/monitor protocols used by
BlueZ, and the first tool that's able to decode this is btmon from
BlueZ ("btmon --tty <tty>").

For platforms with two or more external UARTs it is still possible to
use CONFIG_UART_CONSOLE as long as the UART devices used are
different, however on platforms with a single external UART
UART_CONSOLE should be disabled if BLUETOOTH_DEBUG_MONITOR is enabled
(in this case printk/printf get encoded to the monitor protocol).

Origin: Original
Change-Id: I9d3997c7a06fe48e7decb212b2ac9bd8b8f9b74c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 18:49:11 +03:00
Szymon Janc ad475d863a Bluetooth: Remove RX priority fiber
Processing command complete and status events in separate fiber is not
really needed as those handlers doesn't block nor do heavy computation.
This work can be done directly from ISR making code simpler.
Additionaly priority fiber stack is no longer needed resulting in 256
bytes memory savings.

Change-Id: I2ecb29b720d3a886e7881a2208f697a834f4cdaf
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 15:41:32 +00:00
Szymon Janc 68c707884e Bluetooth: Fail if advertise with unsupported address type
This allows to gracefully handle case when privacy is not enabled.

Change-Id: I3f4ebafd05abe186212b554161d8a8982f58ff45
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 11:07:11 +00:00
Szymon Janc 828fe15bbe Bluetooth: Always use RPA for connection if privacy is enabled
We should always use RPA for outgoing connection if privacy is enabled.
Otherwise privacy might be compromised if connecting to devices that
don't support pairing.

Change-Id: Ib12a5d9dfdc9285b5ff721f0fdb8f824ff1a8f0f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:58:03 +00:00
Szymon Janc 7ba5715ae0 Bluetooth: Remove double address comparison
set_random_address already checks if current random address needs
to be updated so there is no need to double check that before it
is called.

Change-Id: If5fe16f1b886aa877bf014a8977ccaea2c8ba6e0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:57:43 +00:00
Szymon Janc 605f7a0979 Bluetooth: Simplify creation of LE connection
hci_le_create_conn sets controller random address to one from
connection so there is no need to do that again in command status
event.

Change-Id: I22a24a46946413489445e577341cbf6ea68c0964
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:57:02 +00:00
Szymon Janc 4e4b81f06f Bluetooth: Simplify setting advertising parameters
There is no need for special handling of command complete when
using bt_hci_cmd_send_sync for sending HCI command.

Change-Id: I60671e490958e67f5d20dc8c6ddbf51ca839c338
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:55:53 +00:00
Szymon Janc e5493c9ac8 Bluetooth: Simplify setting random address
There is no need for special handling of command complete when
using bt_hci_cmd_send_sync for sending HCI command.

Change-Id: Ib67f06d47249d24854c07be34b0e39f70f5d5170
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-22 07:55:42 +00:00
Szymon Janc cef3c59488 Bluetooth: Refactor bt_init
This makes function flow follow common error handling convention
err = foo()
if (err)
  return err

Change-Id: Ifa3f44e3857b50436212cd5ed240795b220f8a15
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-21 14:03:10 +00:00
Johan Hedberg 560956c54d Bluetooth: Kconfig: Split debug selection into a choice
This prepares for adding other debug types besides the printf-style
logging to the console.

Change-Id: Ic2ed305192491734da991c4f61fdaace03fd60f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 17:46:09 +03:00
Johan Hedberg 5cec79e4c8 Bluetooth: Add dedicated bt_send() function
This helps avoid digging out the driver and send callback pointers,
and helps prepare for extended logging support to export the HCI
traffic externally.

Change-Id: I1a9a58a6b47babed41b5bb9349635478905352e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 14:46:48 +03:00
Arkadiusz Lichwa bf62dfad70 Bluetooth: BR/EDR: Initiate encryption on link
Adds method to start encrypting the link by local controller. Encryption
implies successful authentication to be done before.

> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
	Handle: 11
	Encryption: Enabled (0x01)
> HCI Event: Command Status (0x0f) plen 4
	Set Connection Encryption (0x01|0x0013) ncmd 1
	Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4
	Status: Success (0x00)
	Handle: 11
	Encryption: Enabled with E0 (0x01)

Change-Id: I3bbfc6ca77a6fd088582ab45f14d7c122aec7f05
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:50:31 +00:00
Arkadiusz Lichwa 99483fded6 Bluetooth: BR/EDR: Notify about pairing while JustWorks
In some cases 'justworks' model applied on authentication/pairing process
requires user attention.
BT Core 4.2 says in table 5.7 [Vol 3, Part C, 5.2.2.6] that not always
passkey auto-accept can be applied on both devices involved in SSP
pairing for this authentication association model.

Change-Id: I7cc575ac088bcce7830f22d08e49dab40889f515
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:49:18 +00:00
Arkadiusz Lichwa 9d9e349b31 Bluetooth: BR/EDR: Initiate authentication
Enables initiate authentication using possibility to change security
level on link by calling internal security API. In case of failure
resets pairing state flag to re-enable change security on subsequent
authentication attempts.

To verify the process of authentication run BT shell app from
tests/bluetooth/shell folder and use commands like below:
 >br-connect xx:xx:xx:xx:xx:xx
 [Connected: xx:xx:xx:xx:xx:xx]
 >security 1

HCI log:
> HCI Event: Connect Complete (0x03) plen 11
	Status: Success (0x00)
	Handle: 11
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link type: ACL (0x01)
	Encryption: Disabled (0x00)
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
	Handle: 11
> HCI Event: Command Status (0x0f) plen 4
	Authentication Requested (0x01|0x0011) ncmd 1
	Status: Success (0x00)
> HCI Event: Link Key Request (0x17) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Command Complete (0x0e) plen 10
	Link Key Request Negative Reply (0x01|0x000c) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: PIN Code Request (0x16) plen 6
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	PIN length: 4
	PIN code: 0000
> HCI Event: Command Complete (0x0e) plen 10
	PIN Code Request Reply (0x01|0x000d) ncmd 1
	Status: Success (0x00)
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
> HCI Event: Link Key Notification (0x18) plen 23
	Address: 00:13:17:72:8D:87 (GN Netcom A/S)
	Link key: d9ff76c09284c1ed369851f87d7ac623
	Key type: Combination key (0x00)
> HCI Event: Auth Complete (0x06) plen 3
	Status: Success (0x00)
	Handle: 11

Change-Id: I2d383d34e19c04ead3fa254e5514d5c7f352a21e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-19 12:48:45 +00:00
Jukka Rissanen 3e12469c38 net: rdc: Debug print missing \n in simplerdc plugin
Change-Id: I44e6f170e2928dc72cd17a71f382d63d7100aac9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 13:42:44 +00:00
Johan Hedberg 72ce7c7dc1 Bluetooth: Add support for waiting for "NOP" Command Complete
Some controllers will emit an initial "NOP" Command Complete event
during initialization and expect the host to only send commands once
this event has been received. This patch adds a new Kconfig option to
be used in the case of such controllers and defaults this to true on
Arduino 101 with the H:4 driver where this behavior is currently
observed.

Change-Id: I440f14a7c07ac27545febf9f85ebcc343e2a4558
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-18 12:58:22 +00:00
Jukka Rissanen 54b234634b net: buf: Fix the code indentation in ip_buf_unref()
Change-Id: I75a28b6be648c5ba0a706cacae234e378ba2e4f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:22 +00:00
Jukka Rissanen 44d6a4c101 net: buf: Add reference count check for IP buf
If the buf ref count is already 0 meaning that it is freed,
then do not continue but return.

Change-Id: I6c7e15d48b988fda34af43971c1638fb386100c4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:21 +00:00
Jukka Rissanen ae0d60c575 net: buf: Fix the debug print when unreffing the net_buf
The number of free bufs is just that, no need to +1 it here.

Change-Id: I82549d33b00bd2f421babd10442f4d4a9ad9551b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:21 +00:00
Jukka Rissanen 04dc2fe4e1 net: buf: Check we are not overflowing free buf count
Make sure the number of free bufs will never go over the
allocated limit. This is only used for debugging when printing
the free buf count so this is not very serious issue.

Change-Id: Icb5e34e969cbf07280c24966659addcf32829f7c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:20 +00:00
Jukka Rissanen bf5d208f25 net: buf: Add helper for catching ref counting errors
Add ip_buf_ref() helper that helps to track the calls to
net_buf refcounting in IP stack.

Change-Id: Ie5f5a5d57b6ffcb20df4fbc9f25c6c73a99589df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:20 +00:00
Jukka Rissanen 00891f1d64 net: Removed obsolete print defines from slip driver
Change-Id: I5a1a806b4abf8102d676e49284148323b4908397
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-18 12:07:19 +00:00
Tomasz Bursztyka 8475956600 net: rdc: Make simplerdc a full replacement against nullrdc
Removing nullrdc altogether.

Change-Id: Ic8e73c57c3d469a3ca70a60fe10f5e2aed0ca118
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-18 07:40:56 +00:00
Tomasz Bursztyka 62fd66e240 net: ieee802154: Add a simpler but working default RDC driver
The legacy nullrdc driver is not meant to be power efficient, and
supports requesting ACK on all packets. However, it's logic was based on
former Radio API which let it to read packet synchronously. That's not
working anymore as the new cc2520 driver does not support any
synchronous packet reception.
Thus a new driver, simplerdc, is provided. It supports the same features
as nullrdc, is of course not power efficient and fits properly with
the new driver.

- simplerdc is selected by default.
- to enable ack request on all packet, Kconfig proposes a
  NETWORKING_WITH_15_4_ALWAYS_ACK option.
- simplerdc retransmissions is set to 3, as for nullrdc

Change-Id: I53880fcce5ce00f53831eaeb15d51329121314ec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-18 07:40:55 +00:00
Arkadiusz Lichwa 26a8dcd2c1 Bluetooth: L2CAP: l2cap_chan_get() can get BR/EDR L2CAP SIG channel
Enables to get right channel reference on both connection transports,
LE and BR/EDR.

Change-Id: Ia577963132e3a600cd9a95b90f218a5bffee8e58
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-15 19:15:20 +00:00
Arkadiusz Lichwa c94cfbd4db Bluetooth: L2CAP: l2cap_send_reject() can use BR/EDR L2CAP SIG channel
The L2CAP reject command can now be propagated over both connection
transports, LE and BR/EDR.

Change-Id: Ie8466490ed205e194a586646f496ebfce5ceea70
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-15 18:35:14 +00:00
Grzegorz Kolodziejczyk 52e5c91f37 Bluetooth: Remove redundant returns from switch
Primary and secondary service attributes discovery uses att_find_type,
include service and characteristic uses att_read_type.

Change-Id: Ia3539b446a4afb5c72bc1aba443167be6f893d0d
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-15 17:00:44 +00:00
Szymon Janc c2a1ac8ae7 Bluetooth: Add support for confirming incoming JustWorks pairing
If incoming pairing request would result in JustWorks pairing this
can be used to request consent from user for accepting it.

Change-Id: If0695d0e1bb010bade6a16abe1b57a2ce07856cc
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-14 15:20:03 +00:00
Szymon Janc d11824ff58 Bluetooth: SMP: Refactor pairing request handling
This is in preparation for adding support to confirm incoming pairing
requests. smp_pairing_req is now more similar to smp_pairing_rsp making
code easier to follow.

Change-Id: Ie5a77ae5092b7bbf76a482d0bd49e022c4d19d70
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-14 14:44:43 +00:00
Tomasz Bursztyka af33e21017 net: Test random is necessary to use CC2520 as radio driver
It will not build without it. Generalize it then.

Change-Id: I334586f629de1f057e654a13a1c705cd559b44d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-14 07:49:22 +00:00
Jeremie Garcia 5e6da236cb net: fix uip_udp_conn leak
On each net_receive() call with different destination and/or port,
µIP stack consumes a uip_udp_conns[UIP_UDP_CONNS] entry.
As net_context_put() doesn't free it up, Zephyr applications can very
quickly reach the point where it can no more create new UDP connection
(default UIP_UDP_CONNS value is 10).

This patch is both IPv4 and IPv6 compliant.
It modifies net_context_put() so that it frees up such entries if
a UDP connection is registered for the context provided as argument.

Change-Id: I9abe686c81368231d4443fc53da9038761a1787d
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
2016-04-12 12:40:41 +00:00
Arkadiusz Lichwa af2deb8dea Bluetooth: BR/EDR: Move up code in conn.c
Moves up and consolidate the BREDR specific code to skip certain forward
declaration and to prepare for possibility to initiate authentication
using start_security() routine.

Change-Id: Ic32d7d1376173d47b0eb0481eff37c6e56f995d4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 19:15:24 +00:00
Mariusz Skamra 550d031107 Revert "Bluetooth: Fix compare logic in ATT read rsp"
This reverts commit 3d08d16780.

The Read Response only contains a Characteristic Value that is less than or
equal to (ATT_MTU – 1) octets in length so, condition
(length < bt_att_get_mtu(conn)) is always true, and the full Characteristic
Value will not be read.

Change-Id: I63280e65b4ff5b830295aa9aadebe2758b626912
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-11 15:24:33 +00:00
Arkadiusz Lichwa 435ccd3e81 Bluetooth: BR/EDR: Refactor internals of 'Cancel' authentication API
For better code readability use 'switch-case' statement selecting valid
authentication cancel method. Adds also legacy pairing (pre-SSP) as first
item in valid paring method set.

Change-Id: I4d9c5178526cd5210b844878360d12b58b99a24f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:31 +00:00
Arkadiusz Lichwa 8f844fac29 Bluetooth: BR/EDR: Rename pair method field
Refines pairing method holder name to be more generic in connection object
representing applied method during authentication process.

Change-Id: Ia6f51788912974fbbda26b760d187c0f7e24bb0b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:10 +00:00
Johan Hedberg 54425117d0 Bluetooth: Export helpers for defining buffer pools
Now that the incoming ACL & HCI event pools can be defined externally
to hci_core.c there should be convenience macros to know what's the
minimum required buffer size for these pools.

Change-Id: I6f2a7322a3d77e1304e9d925767a1fd3471c76c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-11 11:52:38 +00:00
Johan Hedberg 30601c09bb Bluetooth: Refactor buffer handling for non-host managed buffers
So far the assumption has been that the host stack manages all
incoming and outgoing buffers. For the incoming buffers (from the
controller) this has required hci_core.c to manage its own pools and
do the host flow control. This setup makes perfect sense for an
architecture where the controller resides remotely on a different CPU
& address space (i.e. the "traditional" HCI transport case).

When the stack runs on a system where the controller resides in the
same address space this setup doesn't work that well. In such a
scenario the incoming buffers are ideally created as low down in the
stack as possible (i.e. below HCI), which means that the current
hci_core.c cannot be responsible for managing their pools.

To allow for both types of architectures this patch introduces a new
BLUETOOTH_HOST_BUFFERS Kconfig option that can be selected to say that
host-side management is desired, or deselected to say that the
controller (residing in the same address space) takes care of managing
the incoming buffers.

So far the incoming buffer types were identified by hci_core.c by
looking at their "free pool" pointers, however as soon as the pools
are allowed to be somewhere else this doesn't work. To solve this we
now require a minimum user data size for all Bluetooth buffers and use
that to store the buffer type.

Change-Id: I14bc32007e3e3f17c654f71f79b520650028d7ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-11 11:52:29 +00:00
Jukka Rissanen 14cc0401b4 Revert "net: Use TICKS_UNLIMITED if there are no timers"
This reverts commit 5680396aaa.

The network timers do not trigger with this patch so this needs
to be reverted for time being.

Change-Id: If653e3ecaae1ebddabe26227af876ff6b592675b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-11 07:33:17 +00:00
Johan Hedberg 30fcb2fdca Bluetooth: L2CAP: Store BR/EDR fixed channel mask per channel
This information will be used to construct the fixed channel mask in
the L2CAP information response.

Change-Id: I66244ca2d5e40b3d204f5115c4bddad578f3ea64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg 8a2c7915e3 Bluetooth: L2CAP: Fix logs to account for BR/EDR signaling channel
The same l2cap_recv function is now used for BR/EDR as well so remove
LE references from the logs.

Change-Id: I841ceea2eee72ee099be922eb00c1f6a3a16a787
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg 52401300f3 Bluetooth: L2CAP: Fix missing line termination
Change-Id: I28f18c1afbb168ed021bd15962b2087066eed341
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:24 +03:00
Arkadiusz Lichwa a5d264774e Bluetooth: BR/EDR: Make available L2CAP signal channel
Makes room for L2CAP signal channel transport and start listening
on signalling CID.

Change-Id: I152973a9a9e672f0b4f66b06055e305561123f34
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:24:01 +00:00
Arkadiusz Lichwa 83674b1d52 Bluetooth: BR/EDR: Get proper L2CAP CID limits
Applies L2CAP CID valid values based on link type and proper limitations
according to BT Core L2CAP spec principles.

Change-Id: Ifa0719cf593d1d22977da59fb8a6c0ed9c3a176b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:20:58 +00:00
Arkadiusz Lichwa f6cdc3f3ab Bluetooth: BR/EDR: Refactor bt_l2cap_connected handler
Makes possible to initiate L2CAP signalling handling on set connection
based on connection transport type.

Change-Id: I114dc3e4408f428301628520a569a2b087c325b8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:19:23 +00:00
Arkadiusz Lichwa d719c362f1 Bluetooth: BR/EDR: Add register routine for L2CAP fixed channel
Makes available to register fixed L2CAP signalling channel on
dedicated channels list.

Change-Id: I9a90a64dac40b34799353ff261ba570541347084
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:54 +00:00
Arkadiusz Lichwa 740bd96abc Bluetooth: Rename bt_l2cap_fixed_chan_register()
Renames routine to be clear to be used to register LE L2CAP fixed
channel only. The routine operates on le_channels list object that also
was renamed to reflect the connection type. Updates all calls to
the procedure in the stack.

Change-Id: I01348b8186a0f537532f6a7b9dc59586827b204b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:26 +00:00
Ravi kumar Veeramally 79bf4a0e5a net: coap: Create buffer while generating observe notification
CoAP observe notifications are originated from server, those
are not replies. So create a new buffer and copy remote address
and port number from obs list. Set udp_conn to null as this is
new buffer. Reason for setting the udp_conn to null is that there
is a chance that buffer might already have udp_conn set due to
reusing same buffers.

Change-Id: I3c7eada987cf539d77ea162b6f5901791cfa6ee0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally db247d0fa1 net: coap: Use correct network buffer in serialization
Need to use the network buffer when sending CoAP serial message
because the message was constructed to net_buf

Change-Id: I74c54178707edf2d8451ce5ac719d63f99661332
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00