Skip to content

Commit

Permalink
Merge commit '3b3de6e2ef84c93ab5e873926d52a576093ae07d'
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo3zehn committed Apr 23, 2024
2 parents 1281351 + 3b3de6e commit 1d5e16b
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 247 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v5.2.0 - 2024-04-23

### Features
- Make IsConnected an abstract member of ModbusClient (#115)

## v5.1.0 - 2024-02-21

### Features
Expand Down
3 changes: 3 additions & 0 deletions doc/dark-mode/public/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
defaultTheme: 'dark'
}
40 changes: 25 additions & 15 deletions doc/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
"files": [
"**/*.csproj"
],
"src": "./../src"
"src": "../src"
}
],
"dest": "./api",
"dest": "api",
"filter": "filterConfig.yml",
"properties": {
"TargetFramework": "netstandard2.1"
}
},
"includePrivateMembers": false,
"disableGitFeatures": false,
"disableDefaultFilter": false,
"noRestore": false,
"namespaceLayout": "flattened",
"memberLayout": "samePage",
"EnumSortOrder": "alphabetic",
"allowCompilationErrors": false
}
],
"build": {
"content": [
{
"files": [
"*.md",
"toc.yml"
]
},
{
"files": [
"api/**.yml",
Expand All @@ -33,7 +35,9 @@
{
"files": [
"samples/**.md",
"samples/**/toc.yml"
"samples/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
Expand All @@ -44,15 +48,21 @@
]
}
],
"dest": "_site",
"output": "_site",
"globalMetadata": {
"_appTitle": "FluentModbus",
"_appFooter": "Copyright © 2019 Vincent Wilms",
"_appFaviconPath": "images/icon.ico",
"_appFooter": "Copyright © 2024 Vincent Wilms",
"_appFaviconPath": "images/icon.png",
"_appLogoPath": "images/logo.svg"
},
"fileMetadataFiles": [],
"template":["default","templates/material"],
"markdownEngineName": "markdig"
"template": [
"default",
"modern",
"dark-mode"
],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": false
}
}
2 changes: 1 addition & 1 deletion doc/samples/modbus_tcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void DoClientWork(ModbusTcpClient client, ILogger logger)
Span<byte> data;

var sleepTime = TimeSpan.FromMilliseconds(100);
var unitIdentifier = 0xFF;
var unitIdentifier = 0x00;
var startingAddress = 0;
var registerAddress = 0;

Expand Down
21 changes: 0 additions & 21 deletions doc/templates/material/partials/head.tmpl.partial

This file was deleted.

202 changes: 0 additions & 202 deletions doc/templates/material/styles/main.css

This file was deleted.

2 changes: 1 addition & 1 deletion doc/toc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Samples
href: samples/

- name: Api Documentation
- name: API
href: api/
5 changes: 5 additions & 0 deletions src/FluentModbus/Client/ModbusClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public abstract partial class ModbusClient
{
#region Properties

/// <summary>
/// Gets the connection status of the underlying client.
/// </summary>
public abstract bool IsConnected { get; }

protected private bool SwapBytes { get; set; }

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/FluentModbus/Client/ModbusRtuClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ModbusRtuClient()
/// <summary>
/// Gets the connection status of the underlying serial port.
/// </summary>
public bool IsConnected => _serialPort?.Value.IsOpen ?? false;
public override bool IsConnected => _serialPort?.Value.IsOpen ?? false;

/// <summary>
/// Gets or sets the serial baud rate. Default is 9600.
Expand Down
10 changes: 5 additions & 5 deletions src/FluentModbus/Client/ModbusTcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public ModbusTcpClient()

#region Properties

/// <summary>
/// Gets the connection status of the underlying TCP client.
/// </summary>
public override bool IsConnected => _tcpClient?.Value.Connected ?? false;

/// <summary>
/// Gets or sets the connect timeout in milliseconds. Default is 1000 ms.
/// </summary>
Expand All @@ -56,11 +61,6 @@ public ModbusTcpClient()

#region Methods

/// <summary>
/// Gets the connection status of the underlying TCP client.
/// </summary>
public bool IsConnected => _tcpClient?.Value.Connected ?? false;

/// <summary>
/// Connect to localhost at port 502 with <see cref="ModbusEndianness.LittleEndian"/> as default byte layout.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "5.1.0",
"version": "5.2.0",
"suffix": ""
}

0 comments on commit 1d5e16b

Please sign in to comment.