Commit Graph

70 Commits

Author SHA1 Message Date
Joe Finney b2f56b97ed
Merge pull request #383 from microbit-sam/ble-memory-fixes
Add "DO NOT PAGE" flag to pairingMode fiber. Store animation in flash.
2018-09-07 18:25:40 +01:00
Joe Finney 34e46f04e4
Merge pull request #382 from microbit-sam/pf-yt-toggle
Use config.json to enable / disable Partial Flashing Service
2018-09-07 17:55:41 +01:00
Sam Kent 8aff0eaf4d Added fiber flag. Shifted image to flash 2018-09-07 17:06:51 +01:00
Sam Kent e08535a647 if def for entire PF service 2018-09-07 13:33:16 +01:00
Joe Finney 7e04b4646b Merge branch 'fix-bt-logo' of git://github.com/microbit-sam/microbit-dal into dal-integration 2018-09-05 10:32:03 +01:00
Sam Kent 26d7b6d420 Partial Flashing disabled by default. Enabled for MakeCode builds 2018-08-29 19:14:08 +01:00
Martin Williams 9f5d5802ed Fix MicroBitPartialFlashingService blockPacketCount increment. If the 5th packet goes missing, the recovery code would have set packetCount based on the wrong blockPacketCount, expecting the same packet numbers again. 2018-08-26 18:10:41 +01:00
Sam Kent f7f4887285 Even better logo 2018-08-08 12:04:41 +01:00
Sam Kent 27c5654db2 Fix BT Logo 2018-08-08 11:52:05 +01:00
Sam Kent e13d31c27a Fix whitespace 2018-07-06 16:57:59 +01:00
Sam Kent 289c4b85d7 Removed packetNum < packetCount check 2018-06-13 17:55:56 +01:00
Sam Kent ac14383c28 packetCount: 0 index; no longer stuck after 256 packets 2018-06-13 11:05:57 +01:00
Sam Kent 040f63b01f
Changes from code review with Joe F (#10)
* Movd MICROBIT_MODE_* defines to MicroBitConfig.h

* Search for embedded source and remove magic

* Fixed memcpy

* Change offset order

* Fixed memcpy for data
2018-06-04 16:13:20 +01:00
Sam Kent 3413d5487d
Added Partial Flashing Service (#9)
* Memory Map + Partial Flash Service

* Moved Partial Flash Service to Management Mode

* PF Service appears in YT Build not PXT

* PF in PXT

* Swapped DFU and PF Services

* Fixing Flash Writew

* write flash via bluetooth

* Partial Flash -  Fixed Address

* Update module.json

* Adjust flash pointer

* Adjust flash start

* Adjust Flash Pointer

* Added offset to xfer

* Writing to FLASH_END

* Writing to FLASH_END

* Modified PFS read callback

* Reenable BLE Security

* removed pf

* Check diff

* Check diff

* Replaced ContextSwitch

* PF

* Test. Writing Hex File to 0x30000

* Writing to PXT empty space

* Reversed byte order

* Flash 16 bytes at once

* Copy data from static var to local var

* blocks -> bytes

* Fixed offset

* Fixed Offset

* Flash to 0x30000 + offset

* Bypass scratch page

* Changed byte order

* Write Without Response

* Without Fast BLE

* Added fast BLE

* Updated Connection Parameters

* Iterate through BLE data bytes

* Get Hashes From PXT Build

* Copy Hash from Flash

* Testing FLASH_END

* Read Hash From Flash

* Read Hash from Flash

* Reading correct hash from mem

* Endianess

* Modified MAGIC

* Fix Start Address

* Sequence #

* Write 0xdeadbeef to 0x36000 on PF Seq # error

* Group 4 packet blocks for writing

* Added error case

* Increased flash write size

* Blocks

* Fire event to write

* Decreased flash time

* Reformat

* Reduced hash size in MemoryMap

* Partial Flashing w/ Notifications

* One Characteristic - WRITE/WRITE_WOUT_RESP/NOTIFY

* Modified WRITE Notification

* Tidied - Moved end of transfer logic

* Removed VI Swap files

* Added Pairing Mode Event ID

* Modified Retransmit behaviour

* updateFlash caused stack overflow

* Removed flash write from memory map

* Instantiate Memory Map where used

* Word aligned. Added Status and Reset commands

* Fixed: storage. becomes storage->

* Fixed warnings: switch case fall through

* Fix Hash

* Rebuild Map everytime

* Hash Error

* Edited animation. Hash testing

* persistent memory map issues

* Moved EOT

* Modified BLE animation. Removed globals from PFS

* Updated MM

* Added incomplete flash flag

* Re added CCS.s
2018-04-16 17:27:14 +01:00
Martin Woolley b7af033351 Simplified code wrt MICROBIT_BLE_ADVERTISING_INTERVAL since it's guaranteed to be defined 2017-08-31 10:59:17 +01:00
Martin Woolley d03ebf7056 Exposed Bluetooth advertising interval as config.json property and set default to 50ms 2017-08-16 12:13:13 +01:00
Martin Woolley 002272e048 Exposed Bluetooth advertising interval as config.json property 2017-08-16 12:05:32 +01:00
Martin Woolley ce70039cb5 added support for Write Without Response to Client Event characteristic 2017-07-23 16:18:35 +01:00
Joe Finney f90ef0030d Merge pull request #296 from smartyw/master
BLE Magnetometer service has new characteristic for requesting calilbration
2017-07-18 11:14:13 +01:00
Martin Woolley 4c1950e007 commented out statements removed 2017-07-18 11:12:07 +01:00
Martin Woolley 5980f9015e Refactored to use only one event handler 2017-07-10 09:13:14 +01:00
Martin Woolley 66fd96b098 Added magnetometer calibration characteristic to the Bluetooth Magnetometer Service 2017-06-06 07:50:03 +01:00
Martin Woolley 621e328df1 Added new Magnetometer Calibration characteristic to Magnetometer Service 2017-05-30 10:17:08 +01:00
Joe Finney e19594c73e Update comment for accuracy 2017-05-27 14:26:50 +01:00
Joe Finney c0995137f0 Cleanup internal method names
- Rename isInput() to isActiveInput() to improve readability
  - Remove isOutput() method
2017-05-25 23:41:37 +01:00
Joe Finney 2fe103f70b Fix MicroBitIOPinService 8bit AnalogInput bug #289
- Analog Input now correctly reads values in the 8 bit range.
- Analog Output now reaches 100% duty cycle for 8 but input value of 255.
- Reintroduce notify() call into updateBLEInputs() method.
- Minor code cleanups
2017-05-25 16:12:24 +01:00
Joe Finney 0aaedaa5d9 Remove repeated code in MicroBitIOPinService 2017-05-25 13:38:40 +01:00
Joe Finney ac5a750757 Remove redundant code in MicroBitIOPinService 2017-05-25 13:25:50 +01:00
Joe Finney 4b3520daa6 Update to MicrobitBLEManager to allow safe storage of BLE bond information 2017-03-01 17:41:28 +00:00
Joe Finney f569f5f6d1 Merge pull request #253 from kartben/fix-uart-read
fix for issue #252: bug in MicroBitUARTService#read when buffer conta…
2017-01-06 17:09:04 +00:00
Martin Woolley 673c16c0ef Moved fiber_remove_idle_component inside condition which delays BLE disconnect 2016-12-20 17:31:40 +00:00
Martin Woolley 404c46251b Delayed disconnecting after pairing complete by 500ms 2016-12-20 13:30:37 +00:00
Martin Woolley ddbcec094e Delayed disconnecting after pairing complete by 500ms 2016-12-20 13:28:10 +00:00
Benjamin Cabé 192c9664b2 update condition to avoid reading an extra character after len characters have been read
Signed-off-by: Benjamin Cabé <benjamin@eclipse.org>
2016-12-20 10:15:50 +01:00
Benjamin Cabé 5ba5ccb712 fix for issue #252: bug in MicroBitUARTService#read when buffer contains NULL character
Signed-off-by: Benjamin Cabé <benjamin@eclipse.org>
2016-12-19 17:18:27 +01:00
James Devine 10ce2b9f7a microbit-dal: removed ManagedString APIs for Eddystone Uid
ManagedString should only be used for string based data.
The APIs removed by this commit presumed that this was not the case.
ManagedString implicitly contains error checking, which makes it
unsuitable for sequences of bytes that may contain null termination
characters (0x00).

Removing these APIs for now was the best option until a future time
when ManagedBuffer can be used within the runtime.
2016-11-30 11:22:54 +00:00
James Devine 95346586ab microbit-dal: Revisions to MicroBitEddystone.
This commit includes the addition of comments,
some validation and corrections to C++ definitions.

Also, a minor API revision for the Eddystone class, which
simple removes Eddystone from member functions, as it
it implicit that you will be setting a URL using Eddystone
in the MicroBitEddystone class.
2016-11-30 10:43:53 +00:00
Martin Woolley 4857c83446 source code pretty formatted 2016-10-28 12:15:54 +01:00
Martin Woolley 15db7558f5 Refactored Eddystone support, introducing a new Eddystone class which separates the Eddystone message format from the more general responsibilities of the MicroBitBLEManager class. Hopefully the pattern paves the way for other beacon formats (e.g. iBeacon, AltBeacon) to be introduced via their own classes.
Added support for the Eddystone UID frame type.

Example use:

```
char UID_NAMESPACE[] = {0x0E,0x67,0x47,0x04,0x42,0xD0,0x14,0x06,0xD5,0x83}; // sha-1 hash of "com.bittysoftware"
char UID_INSTANCE[]  = {0x00 , 0x00, 0x00, 0x00, 0x00, 0x01};

uint8_t advertising = 0;
uint8_t tx_power_level = 6;

void startAdvertising() {
    uBit.bleManager.advertiseEddystoneUid(UID_NAMESPACE, UID_INSTANCE, tx_power_level, false);
    uBit.bleManager.setTransmitPower(6);
    uBit.display.scroll("ADVERTISING");
    advertising = 1;
}
```
2016-10-27 11:01:04 +01:00
Martin Woolley 75b26f8339 Made MicroBitBLEManager more singleton-like. Made class instance variable public static.
Refactored Eddystone support, moving frame content code to new MicroBitEddystone class in anticipation of adding other frame formats.
2016-10-26 14:58:09 +01:00
Martin Woolley 5d32e70367 Made MicroBitBLEManager more singleton-like
Refatcored Eddystone support, moving frame content code to new MicroBitEddystone class.
2016-10-26 14:15:56 +01:00
Martin Woolley 4ad61def37 Support for Just Works pairing 2016-09-28 13:44:37 +01:00
Thomas Beverley c95c8e32ae Added connectable flag to advertise eddystoneurl func 2016-09-28 10:07:48 +00:00
Thomas Beverley 05f60d018c Renamed physical web to be eddystone url 2016-09-27 13:01:49 +00:00
Thomas Beverley 93f22b33a1 Fixed internval typo 2016-09-27 10:33:58 +00:00
Thomas Beverley 145d8c3d7a Optionally include physical web code depending on microbit-dal.bluetooth.physical_web from the config.json file 2016-09-27 10:27:59 +00:00
Thomas Beverley 93917402e6 Changed uint8_t to be int8_t for calibration and added transmission interval as optional parameter to physical web transmission 2016-09-27 10:01:54 +00:00
Thomas Beverley 95dc970024 Fixed typo in callibratedPower -> calibratedPower 2016-09-27 08:13:44 +00:00
Thomas Beverley 5617cc600d Added ManagedString variant to advertisePhysicalWebUrl. Renamed stopAdvertise to stopAdvertising. Improved the docs around these two methods 2016-09-27 08:05:30 +00:00
Thomas Beverley 2f0db1ed2c Added physical web transmission 2016-09-26 12:26:13 +00:00