Skip to content

Commit a1fdb86

Browse files
committed
main struct public
1 parent 39b602b commit a1fdb86

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func TestTelemetry(t *testing.T) {
12-
telemetry := acctelemetry.AccTelemetry()
12+
telemetry := acctelemetry.New()
1313
err := telemetry.Connect()
1414
if err != nil {
1515
t.Error(fmt.Errorf("unable to connect to ACC: %w", err))

telemetry.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const STATIC_FILE_MMAP = "Local\\acpmf_static"
99
const PHYSICS_FILE_MMAP = "Local\\acpmf_physics"
1010
const GRAPHIS_FILE_MMAP = "Local\\acpmf_graphics"
1111

12-
type accTelemetry struct {
12+
type AccTelemetry struct {
1313
staticData *accDataHolder[AccStatic]
1414
physicsData *accDataHolder[AccPhysics]
1515
graphicsData *accDataHolder[AccGraphic]
@@ -29,7 +29,7 @@ func (d *accDataHolder[T]) Close() error {
2929
return nil
3030
}
3131

32-
func (t *accTelemetry) Connect() error {
32+
func (t *AccTelemetry) Connect() error {
3333
var accStatic AccStatic
3434
staticMMap, err := mapFile(STATIC_FILE_MMAP, unsafe.Sizeof(accStatic))
3535
if err != nil {
@@ -63,26 +63,26 @@ func (t *accTelemetry) Connect() error {
6363
return nil
6464
}
6565

66-
func AccTelemetry() *accTelemetry {
67-
return &accTelemetry{}
66+
func New() *AccTelemetry {
67+
return &AccTelemetry{}
6868
}
6969

7070
// this returns direct pointer to the memory so underlying struct will change over time
71-
func (t *accTelemetry) GraphicsPointer() *AccGraphic {
71+
func (t *AccTelemetry) GraphicsPointer() *AccGraphic {
7272
return t.graphicsData.data
7373
}
7474

7575
// this returns direct pointer to the memory so underlying struct will change over time
76-
func (t *accTelemetry) StaticPointer() *AccStatic {
76+
func (t *AccTelemetry) StaticPointer() *AccStatic {
7777
return t.staticData.data
7878
}
7979

8080
// this returns direct pointer to the memory so underlying struct will change over time
81-
func (t *accTelemetry) PhysicsPointer() *AccPhysics {
81+
func (t *AccTelemetry) PhysicsPointer() *AccPhysics {
8282
return t.physicsData.data
8383
}
8484

85-
func (t *accTelemetry) Close() error {
85+
func (t *AccTelemetry) Close() error {
8686
t.graphicsData.Close()
8787
t.staticData.Close()
8888
t.physicsData.Close()

0 commit comments

Comments
 (0)