Smdn.Devices.BP35XX 2.1.0

Prefix Reserved
dotnet add package Smdn.Devices.BP35XX --version 2.1.0                
NuGet\Install-Package Smdn.Devices.BP35XX -Version 2.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Smdn.Devices.BP35XX" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smdn.Devices.BP35XX --version 2.1.0                
#r "nuget: Smdn.Devices.BP35XX, 2.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Smdn.Devices.BP35XX as a Cake Addin
#addin nuget:?package=Smdn.Devices.BP35XX&version=2.1.0

// Install Smdn.Devices.BP35XX as a Cake Tool
#tool nuget:?package=Smdn.Devices.BP35XX&version=2.1.0                

Smdn.Devices.BP35XX 2.1.0

Smdn.Devices.BP35XX is a library that provides APIs to operate ROHM BP35A1 and other ROHM Wi-SUN modules using the Skyley Networks' SKSTACK IP command.

Getting started

First, add package Smdn.Devices.BP35XX to the project file.

dotnet add package Smdn.Devices.BP35XX

For using BP35A1, use the BP35A1.CreateAsync method to create an instance of the device.

// SPDX-FileCopyrightText: 2024 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
using System;

using Smdn.Devices.BP35XX;

using var device = await BP35A1.CreateAsync(
  new BP35A1Configurations() {
    SerialPortName = "/dev/ttyACM0", // Specify a port name such as COM1 on Windows
    TryLoadFlashMemory = true, // Try to load configurations stored in flash memory
  }
);

Console.WriteLine("SkStack information");
Console.WriteLine($"  Version     : {device.SkStackVersion}");
Console.WriteLine($"  App version : {device.SkStackAppVersion}");
Console.WriteLine();

Console.WriteLine("BP35A1 device information");
Console.WriteLine($"  MAC address         : {device.MacAddress}");
Console.WriteLine($"  Link local address  : {device.LinkLocalAddress}");
Console.WriteLine();

Console.WriteLine("ROHM user information");
Console.WriteLine($"  User ID  : {device.RohmUserId}");
Console.WriteLine($"  Password : {device.RohmPassword}");
Console.WriteLine();

var uartOptions = await device.GetUartOptionsAsync();

Console.WriteLine("UART options");
Console.WriteLine($"  Baud rate          : {uartOptions.BaudRate}");
Console.WriteLine($"  Flow control       : {uartOptions.FlowControl}");
Console.WriteLine($"  Character interval : {uartOptions.CharacterInterval}");
Console.WriteLine();

var udpDataFormat = await device.GetUdpDataFormatAsync();

Console.WriteLine($"ERXUDP format: {udpDataFormat}");
Console.WriteLine();

More examples can be found on the GitHub repository, including examples of using library features.

Contributing

This project welcomes contributions, feedbacks and suggestions. You can contribute to this project by submitting Issues or Pull Requests on the GitHub repository.

Notice

License

This project is licensed under the terms of the MIT License.

Disclaimer

(An English translation for the reference follows the text written in Japanese.)

本プロジェクトは、Skyley Networks、およびSKSTACK IPを搭載する製品の製造元・供給元・販売元とは無関係の、非公式なものです。

This is an unofficial project that has no affiliation with Skyley Networks and the manufacturers/vendors/suppliers of the products that equipped with SKSTACK IP.

Third-Party Notices

See ThirdPartyNotices.md for detail.

API List

List of APIs exposed by assembly Smdn.Devices.BP35XX-2.1.0 (net8.0)

// Smdn.Devices.BP35XX.dll (Smdn.Devices.BP35XX-2.1.0)
//   Name: Smdn.Devices.BP35XX
//   AssemblyVersion: 2.1.0.0
//   InformationalVersion: 2.1.0+fc01bab8c6330c41db1ce6309f8f5f79b42b2785
//   TargetFramework: .NETCoreApp,Version=v8.0
//   Configuration: Release
//   Referenced assemblies:
//     Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
//     Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
//     Smdn.Fundamental.PrintableEncoding.Hexadecimal, Version=3.0.0.0, Culture=neutral
//     Smdn.Net.SkStackIP, Version=1.0.0.0, Culture=neutral
//     System.ComponentModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.IO.Ports, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
//     System.Memory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
//     System.Net.NetworkInformation, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Net.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
#nullable enable annotations

using System;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using Smdn.Devices.BP35XX;
using Smdn.Net.SkStackIP;

namespace Smdn.Devices.BP35XX {
  public interface IBP35SerialPortStreamFactory : IDisposable {
    Stream CreateSerialPortStream(string? serialPortName);
  }

  public enum BP35UartBaudRate : byte {
    Baud115200 = 0,
    Baud19200 = 4,
    Baud2400 = 1,
    Baud38400 = 5,
    Baud4800 = 2,
    Baud57600 = 6,
    Baud9600 = 3,
  }

  public enum BP35UartCharacterInterval : byte {
    Microseconds100 = 16,
    Microseconds200 = 32,
    Microseconds300 = 48,
    Microseconds400 = 64,
    Microseconds50 = 80,
    None = 0,
  }

  public enum BP35UartFlowControl : byte {
    Disabled = 0,
    Enabled = 128,
  }

  public enum BP35UdpReceiveDataFormat : byte {
    Binary = 0,
    HexAscii = 1,
  }

  public class BP35A1 : BP35Base {
    public static ValueTask<BP35A1> CreateAsync(BP35A1Configurations configurations, IServiceProvider? serviceProvider = null, CancellationToken cancellationToken = default) {}
    public static ValueTask<BP35A1> CreateAsync(string? serialPortName, IServiceProvider? serviceProvider = null, CancellationToken cancellationToken = default) {}
  }

  public sealed class BP35A1Configurations {
    public BP35A1Configurations() {}

    public BP35UartBaudRate BaudRate { get; set; }
    public string? SerialPortName { get; set; }
    public bool TryLoadFlashMemory { get; set; }
    public bool UseFlowControl { get; set; }
  }

  public abstract class BP35Base : SkStackClient {
    public IPAddress LinkLocalAddress { get; }
    public PhysicalAddress MacAddress { get; }
    public string RohmPassword { get; }
    public string RohmUserId { get; }
    public string SkStackAppVersion { get; }
    public Version SkStackVersion { get; }

    public async ValueTask<BP35UartConfigurations> GetUartOptionsAsync(CancellationToken cancellationToken = default) {}
    public async ValueTask<BP35UdpReceiveDataFormat> GetUdpDataFormatAsync(CancellationToken cancellationToken = default) {}
    public ValueTask SetUartOptionsAsync(BP35UartBaudRate baudRate, BP35UartCharacterInterval characterInterval = BP35UartCharacterInterval.None, BP35UartFlowControl flowControl = BP35UartFlowControl.Disabled, CancellationToken cancellationToken = default) {}
    public ValueTask SetUartOptionsAsync(BP35UartConfigurations uartConfigurations, CancellationToken cancellationToken = default) {}
    public ValueTask SetUdpDataFormatAsync(BP35UdpReceiveDataFormat format, CancellationToken cancellationToken = default) {}
  }

  public class BP35SerialPortException : IOException {
    public BP35SerialPortException() {}
    public BP35SerialPortException(string message) {}
    public BP35SerialPortException(string message, Exception? innerException = null) {}
  }

  public readonly struct BP35UartConfigurations {
    public BP35UartConfigurations(BP35UartBaudRate baudRate, BP35UartCharacterInterval characterInterval, BP35UartFlowControl flowControl) {}

    public BP35UartBaudRate BaudRate { get; }
    public BP35UartCharacterInterval CharacterInterval { get; }
    public BP35UartFlowControl FlowControl { get; }

    public void Deconstruct(out BP35UartBaudRate baudRate, out BP35UartCharacterInterval characterInterval, out BP35UartFlowControl flowControl) {}
  }
}
// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.4.1.0.
// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.1.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Smdn.Devices.BP35XX:

Package Downloads
Smdn.Net.EchonetLite.RouteB.BP35XX

BP35A1など、Skyley Networksの[SKSTACK IP](https://www.skyley.com/wiki/?SKSTACK+IP+for+HAN)を搭載する[ROHM Wi-SUNモジュール](https://www.rohm.co.jp/products/wireless-communication/specified-low-power-radio-modules)を使用して、スマート電力量メータとの情報伝達手段である「Bルート」を介したECHONET Lite規格の通信を扱うためのAPIを提供します。 ECHONET Lite規格における下位通信層に相当する実装を作成するファクトリクラス`BP35A1RouteBEchonetLiteHandlerFactory`をはじめとするAPIを提供します。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 102 11/14/2024
2.0.0 175 9/6/2024
1.0.0 184 4/6/2024