The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Change-Id: I1af8b2888779b2b58367feaff9ee1a6d97b4873c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for forward/backward ANSI sequences and the ability to
enter new text while the cursor is somewhere in the middle of the line
rather than at the end of it. printk is introduced into the game
rather than the old write_uart() since we need to make use of the
%u format string support for creating the ANSI sequence to move
backward/forward the right number of characters.
Change-Id: I41f880fc5de773573147c5a291e2cbe94d5370a4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
By default, since we don't have special support for control characters
we should simply ignore them. This includes both pure (single) control
characters as well as ANSI escape sequences. The most important
control character to support for basic editing is Backspace.
The terminal creates a Delete (DEL) character by default when
Backspace is pressed. It also treats the Backspace character ('\b') as
a non-destructive backspace. To create the effect of destructive
backspace we have to send the sequence "\b \b".
Change-Id: Idc942d09be2a84b8dd0a60ace8429102c6c7e355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add a simple implementation of isprint() which is used to test for a
printable character.
Change-Id: I0ebca10ec0f8e43ee245f6508c5b82c6e207bd32
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To clean up the logic and prepare for more control character support,
change the behavior so that instead of treating end of buffer as a
forced line break simply stop incrementing the position variable until
getting a carriage return.
Change-Id: Ie3970cb779dac3c826a3d21cf0b9ae57a43eddb2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The terminal doesn't generate line feed ('\n') when pressing return,
rather only a carriage return, so we can simplify the condition for
handling end of line.
Change-Id: I3eef8c6af19c43ef98ccdd9a5e3662d280834425
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Completely overhauls Kernel Primer section on mailboxes to fill in
a host of omissions, correct errors, and improve readability.
Change-Id: I7f27230f59a593f6b7f44f399363ba423156b43e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Now that the H:4 driver is the default it doesn't have to be
explicitly enabled anymore. The only exception is the "no default
driver" option that's needed by the test_bluetooth unit test.
Change-Id: Ie582d51202714e314b76ffa9659c7a232a18fc1a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that the HCI driver is called H:4 use the shorter driver-specific
prefix h4_* for its internal symbols.
Change-Id: Icdab1147e5ec31f84e0a3d810192ddd462f4dfdd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll in the future also have a three-wire UART (H:5) HCI driver, so
the current H:4 driver cannot have a generic name.
Change-Id: Id326ae63d6f4d273d0d0c6120143e2f8d62968d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Whenever selects BR/EDR support in Kconfig, make BLUETOOTH_CONN
option be set as well due to for BR/EDR devices fundamental behaviour
is interact with others by making ACL based connections.
Change-Id: Ieffd2fc6aa47278112be177e5a7e2021e50b0fa3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
As a cleanup of just made disconnection don't touch LE specific
actions.
Change-Id: I0c7c42f47ac8f6683380124df571fa2b2afbf526
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Enables getting by host connection complete event and handle
internal state of related to the event connection object.
Change-Id: Ie6252ff33cc2e1fff5a4ce746fda7c3a59bf8aab
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Defines helper routine to look up conn pool object for existance
of instance matching requested bluetooth address.
Change-Id: I31e05afb2346c7dab14e7ba1bd2f4e1378876ae0
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
To conform to API convention rename BT_CONN_TYPE_BREDR to BT_CONN_TYPE_BR.
Updates stack code so far uses it.
Change-Id: Ia759ef68bbdb232e3b0992740e0536d310e19010
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Applications may want to protect the privacy (identity of the local
device). One way to do this is to generate a Non-resolvable Private
Address and use that when advertising.
Change-Id: Ib852b03c14af062f914aa99a14e50c2e52ac78c2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Calling bt_rand() while holding a HCI cmd net_buf will (at least right
now) allocate a second HCI cmd net_buf. The default HCI cmd net_buf
count is 2, so if the caller of le_set_nrpa() also does a similar
trick this would leave to a deadlock. Doing the bt_rand() call first
solves the issue.
Change-Id: I4d6e3f448930bb1fa0456c9603dce62146fb545e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There's no reason for us to go revealing our public address when doing
active scanning.
Change-Id: I27bed74bb377b8bba75843ea76acb8f0d58f70f7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll need this e.g. for NRPA generation even when SMP isn't enabled.
Change-Id: I4bffca3a180fda8f6757e902f8e255ba497b0bf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Applications may want fine-grained control of connection parameters.
The two APIs to provide this through are bt_le_set_auto_conn() as well
as bt_conn_create_le().
Change-Id: If5cddbbf017b868d768d18d2a09daf4af8aa00d8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There is no need to lookup SMP context again from conn object if
SMP context is already found.
Change-Id: I47ed1da69dc3030021c16579f8039e376ba11320
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If HCI based ECC is used we should delay sending local Public Key in
LE SC pairing until it is generated by controller.
Change-Id: Ic979fc8efa40a8089ac2b74cbcfac21bdca79bfe
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Use same ifdefs rule in all places in SMP code. This makes code
easier to read.
Change-Id: I6936ca6f7a0212fc1918ed18d247f3e6d73f0370
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
SMP code is cutted by ifdefs for central and peripheral roles support.
To make code easier to understand we follow same rule for all code:
if (conn->role == BT_HCI_ROLE_MASTER) {
/* master specififc code */
return;
}
/* slave specififc code */
This simple rule allows for covering all build options (only central,
only peripheral or both) in clean way.
Change-Id: I37e65e7444090860069bfa6e9adc5cae07f0c0b9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allow to reuse same code in follow-up patch.
Change-Id: Ie057943f72b0c3c77d44590b56dd5ff9aa53005f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>