MaP1058_socket_client

package module
v0.0.0-...-d6b8a38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 12 Imported by: 0

README

MaP1058-socket-client

Go socket client capturing bio-signals sent from MaP1058

Usage

Short example of usage:

package your_package

import (
    "time"
    "github.com/ISDL-dev/MaP1058-socket-client/client"
)

func YourFunc() {
    conf := client.Config{
        ServerIP: "192.168.10.101",
        SaveDir:  "./output",
    }
    c, _ := client.NewClient(conf)
    c.Start(time.Minute * 5)
}

The above code will create a client receiving bio-signals from MaP1058 and save them in the ./output directory for 5 minutes.
Full example is at cmd/example/main.go.

Utility Commands

transpose command

run the following command to relocate signals in a recorded csv to the right

go run cmd/transpose/main.go -i <input csv file path> -o <output csv file path> --trim-index true

input csv file should be like the following:

pnt,ch1,ch2,ch3,ch4,ch5,ch6,ch7,ch8
1,123,123,123,123,123,123,123,123
2,456,456,456,456,456,456,456,456
3,789,789,789,789,789,789,789,789

the result will be like the following:

1,2,3
123,456,789
123,456,789
123,456,789
123,456,789
123,456,789
123,456,789
123,456,789
123,456,789

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteSetting

func WriteSetting(stg *model.Setting, dir string) error

Types

type Client

type Client interface {
	// Start sends a command to start recording and receives some commands
	// containing signals and measurement conditions.
	Start(rec time.Duration) error
	// Stop sends a command to stop recording.
	Stop() error
}

func NewClient

func NewClient(c Config) (Client, error)

type Config

type Config struct {
	// ServerIP is the IP address of MaP1058.
	ServerIP string
	// SaveDir is the directory to save received signals and configuration.
	SaveDir string
}

Config is the configuration for MaP1058 client

Directories

Path Synopsis
cmd
internal
adapter/mock
Package mock_adapter is a generated GoMock package.
Package mock_adapter is a generated GoMock package.
parser/mock
Package mock_parser is a generated GoMock package.
Package mock_parser is a generated GoMock package.
scanner/mock
Package mock_scanner is a generated GoMock package.
Package mock_scanner is a generated GoMock package.
socket/mock
Package mock_socket is a generated GoMock package.
Package mock_socket is a generated GoMock package.
socket/test_client
a client to check the connection with a server
a client to check the connection with a server
socket/test_server
an echo server to check the connection with a client
an echo server to check the connection with a client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL