Skip to content

Commit 4aa436b

Browse files
committed
Rename core article sections and update toc
1 parent fb57c5c commit 4aa436b

8 files changed

Lines changed: 53 additions & 49 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Firmware update
1+
# Firmware
2+
3+
## Updating device firmware
24

35
As `Harp Devices` are updated, new features are added and bugs are fixed. To ensure that your device is running the latest firmware, you can use the `Device Setup` tool available in Bonsai. This tool will be available with the `Bonsai.Harp.Design` package. To launch it, simply add a generic `Device` node to your workflow, and open its default editor (by double-clicking on the node). If an `Harp Device` is detected on the currently selected `COM port`, the following dialog will appear:
46

articles/getting-started.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

articles/intro.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Getting started with Bonsai.Harp
2+
3+
The process of setting up your system to be able to use the `Bonsai.Harp` package is simple, and documented in the next few steps:
4+
5+
1. Install Bonsai (if not already installed) by following the instructions available [here](https://bonsai-rx.org/docs/articles/installation.html).
6+
7+
2. Install the FTDI drivers necessary for the USB communication between Harp device and the host PC. For Windows, these can be found [here](https://www.ftdichip.com/old2020/Drivers/CDM/CDM%20v2.12.26%20WHQL%20Certified.zip).
8+
9+
3. Download the latest release of the `Bonsai.Harp` package through the Bonsai Package Manager. [Detailed instructions can be found here.](https://bonsai-rx.org/docs/articles/packages.html) We also advise you to download the `Bonsai.Harp.Design` package that adds useful functionality to the package such has additional dialogs and visualizers.
10+
11+
4. Install the device specific package for the Harp device you are using. First, change `package source` to `nuget.org` then, in the search bar, look for your device by typing: `harp.<device>`. For instance, for the Harp Behavior board, you would get:
12+
13+
![HarpDevicePackage](~/images/behaviorpackage.png)
14+
15+
5. The device nodes should now be available in the Bonsai Toolbox. You can now start using them in your workflows.
File renamed without changes.

articles/manipulating-messages.md

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
# Manipulating timestamped streams
1+
# Manipulating `HarpMessage` objects
2+
3+
## Modifying `HarpMessage` Fields
4+
5+
So far, we have covered how to generate `HarpMessages` using a constructor operator (*i.e.* [`CreateMessage`](xref:Bonsai.Harp.CreateMessage)) or by using [`Format`](xref:Bonsai.Harp.Format) with compatible data types. However, in specific cases, we might want to take a given `HarpMessage` and simply change the value of one or more of it fields, for example its `Address`. While one could, in theory, [`Parse`](xref:Bonsai.Harp.Parse) the incoming message into its components and "reassemble" everything with the aforementioned operators, this tends to be too cumbersome. As an alternative, one can use a different overload of [`Format`](xref:Bonsai.Harp.Format) that takes an `HarpMessage` and replaces the value of one or more of its fields by non-null values defined in the properties of the operator. This overload is only available when the `Register` property of the [`Parse`](xref:Bonsai.Harp.Format) operator is set to [`FormatMessagePayload`](xref:Bonsai.Harp.FormatMessagePayload). For instance, if one would like to change the `Address` of an `HarpMessage`:
6+
7+
:::workflow
8+
![ModifyHarpMessageAddress](~/workflows/modify-message-address.bonsai)
9+
:::
10+
11+
It should be noted that multiple fields can be changed simultaneously by settings the corresponding property to a non-null value.
12+
13+
## Injecting timestamps in `HarpMessage` `Payload`
14+
15+
Finally, we can inject a timestamp into a `HarpMessage` by also using the [`Format`](xref:Bonsai.Harp.Format) operator. This is done by providing an input in the form of a `Timestamped<T>`, where `T` must be a compatible type. For instance, if one would want to set the timestamp of a given message to `0`:
16+
17+
:::workflow
18+
![ModifyHarpMessageTimestampFromDouble](~/workflows/modify-message-double-timestamp.bonsai)
19+
:::
20+
21+
Alternatively, one can also construct the [`Timestamped<T>`](xref:Bonsai.Harp.Timestamped) from another using another timestamped `HarpMessage`:
22+
23+
:::workflow
24+
![ModifyHarpMessageTimestamp](~/workflows/modify-message-timestamp.bonsai)
25+
:::
26+
27+
## Manipulating timestamped streams
228

329
While the `Timestamped` portion of an Harp Message is optional, it is often useful to have access to it. After all, it provides temporal information on `Events` and `Commands`, and can be used to perform time-based operations on the data. The `Bonsai.Harp` library provides a set of operators that can be used to manipulate the `Timestamped` portion of a [`HarpMessage`](xref:Bonsai.Harp.HarpMessage).
430

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Bonsai.Harp
1+
# Operators
22

3-
All [Harp Devices](https://harp-tech.org/Devices/device_list.html) implement the [Harp Protocol](https://harp-tech.org/About/How-HARP-works/index.html) via which they can communicate with an host PC. The `Bonsai.Harp` library provides an implementation of the Harp protocol that can be used to interface with any Harp device.
3+
All [Harp Devices](https://harp-tech.org/Devices/device_list.html) implement the [Harp Protocol](https://harp-tech.org/About/How-HARP-works/index.html) to communicate with an host PC. The `Bonsai.Harp` library provides an implementation of the Harp protocol that can be used to interface with any Harp device.
44

55
The `Bonsai.Harp` library provides the following operators:
66

@@ -13,7 +13,7 @@ It is crucial to understand the function of each of these operators as they are
1313
The [`Device`](xref:Bonsai.Harp.Device) operator is the first node you will probably add to your workflow when using any Harp Device. This source is responsible for establishing a serial connection link with the device and providing an interface that can be used to send and receive messages, represented by [`HarpMessage`](xref:Bonsai.Harp.HarpMessage) objects. Messages sent from the host application into the node represent commands to be sent to the device, whereas message objects emitted by the device node represent command replies or events sent by the device to the host.
1414

1515
> [!Note]
16-
> The `Device` node also provides a default editor that allows you to configure core device settings and upload new firmware to the board in the form of `.hex` files. To open this dialog you can simply double-click the node while bonsai is not running.
16+
> The `Device` node also provides a default editor that allows you to configure core device settings and upload new firmware to the board in the form of `.hex` files. To open this dialog you can simply double-click the node while the workflow is not running.
1717
1818
The current specification of the `Harp Protocol` defines three [`HarpMessage types`](xref:Bonsai.Harp.MessageType):
1919

articles/toc.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
- name: Getting Started
2-
href: harp-core.md
32
items:
3+
- name: Quickstart
4+
href: intro.md
45
- name: Operators
5-
href: harp-core.md
6+
href: operators.md
67
- name: Firmware Updates
7-
href: firmware-updates.md
8+
href: firmware.md
89
- name: Logging
9-
href: logging-harp-messages.md
10+
href: logging.md

0 commit comments

Comments
 (0)