Skip to content

Commit

Permalink
main [v0.4.4]
Browse files Browse the repository at this point in the history
 in-line cleaning
  • Loading branch information
SUNsung committed Sep 12, 2024
1 parent 1f0624d commit 9edde93
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _run/values/ver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.3
v0.4.4
32 changes: 32 additions & 0 deletions acceptor/acceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,38 @@ var WasStopped bool
var OpenThread bool
var FlashDownloadThread bool

//

func Clean() {
Connected = false
AutoStack = false
HighSecurity = false

InSoftResetOneSecondIgnore = false
InSoftResetWaitForReply = false
ExpandedNoteReporting = false
IsQueryDeviceCapabilitiesSupported = false
IsCheated = false
IsPoweredUp = false
IsInvalidCommand = false
WasDocTypeSetOnEscrow = false
WasDisconnected = false
IsVeryFirstPoll = false
StopWorkerThread = false
StopOpenThread = false
StopFlashDownloadThread = false
SuppressStandardPoll = false
WasStopped = false
OpenThread = false
FlashDownloadThread = false

Cap = CapStruct{}
Cash = CashStruct{}
Device = DeviceStruct{}
Enable = EnableStruct{}
Timeout = TimeoutStruct{}
}

////

func ConstructOmnibusCommand(payload []byte, controlCode consts.CmdType, data0Index int, billTypeEnables []bool) {
Expand Down
4 changes: 4 additions & 0 deletions command/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ func CRC(command []byte) byte {

return result
}

func Clean() {
coin = false
}
6 changes: 3 additions & 3 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package mpost
const (
GlobalName string = "mpost"
GlobalDateUpdate string = "09-12-2024"
GlobalHash string = "38d436fb02c32ff6111f28ca1db70b3bc4ddf157"
GlobalHash string = "1f0624da6b982a29ae3e4ab0e322551de126e89d"

GlobalVersion string = "v0.4.3"
GlobalVersion string = "v0.4.4"
GlobalVersionMajor string = "v0"
GlobalVersionMinor uint16 = 4
GlobalVersionPatch uint16 = 3
GlobalVersionPatch uint16 = 4
)
31 changes: 31 additions & 0 deletions hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,34 @@ var eventHandlers = make(map[enum.EventType]func(int), enum.Event_End)
func Add(ev enum.EventType, h func(int)) {
eventHandlers[ev] = h
}

func Clean() {
eventHandlers = make(map[enum.EventType]func(int), enum.Event_End)

Connected = false
Escrow = false
PUPEscrow = false
Stacked = false
Returned = false
Rejected = false
Cheated = false
StackerFull = false
CalibrateStart = false
CalibrateProgress = false
CalibrateFinish = false
DownloadStart = false
DownloadRestart = false
DownloadProgress = false
DownloadFinish = false
PauseDetected = false
PauseCleared = false
StallDetected = false
StallCleared = false
JamDetected = false
JamCleared = false
PowerUp = false
InvalidCommand = false
CashBoxAttached = false
CashBoxRemoved = false
Disconnected = false
}
6 changes: 6 additions & 0 deletions mpost.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package mpost

import (
"context"
"github.com/hard-soft-ware/mpost/acceptor"
"github.com/hard-soft-ware/mpost/command"
"github.com/hard-soft-ware/mpost/enum"
"github.com/hard-soft-ware/mpost/hook"
"github.com/hard-soft-ware/mpost/serial"
Expand Down Expand Up @@ -32,6 +34,10 @@ func New() *MpostObj {
Log: newLog(),
}

acceptor.Clean()
command.Clean()
hook.Clean()

obj.Method = obj.newMethods()
obj.Ctx, obj.CtxCancel = context.WithCancel(context.Background())

Expand Down

0 comments on commit 9edde93

Please sign in to comment.