This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduce use case specific interface - Introduce generic event mechanism
- Loading branch information
Showing
167 changed files
with
12,882 additions
and
7,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
with-expecter: true | ||
inpackage: false | ||
dir: "{{ .InterfaceDir }}/mocks/" | ||
mockname: "{{.InterfaceName}}" | ||
outpkg: "mocks" | ||
filename: "{{.InterfaceName}}.go" | ||
all: true | ||
packages: | ||
github.com/enbility/cemd/api: | ||
github.com/enbility/cemd/evsecc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
package api | ||
|
||
import ( | ||
shipapi "github.com/enbility/ship-go/api" | ||
spineapi "github.com/enbility/spine-go/api" | ||
"github.com/enbility/spine-go/model" | ||
) | ||
|
||
// Implemented by *Solutions, used by Cem | ||
type SolutionInterface interface { | ||
RegisterRemoteDevice(details *shipapi.ServiceDetails, dataProvider any) any | ||
UnRegisterRemoteDevice(remoteDeviceSki string) | ||
//go:generate mockery | ||
|
||
// Implemented by CEM | ||
type CemInterface interface { | ||
// Setup the EEBUS service | ||
Setup() error | ||
|
||
// Start the EEBUS service | ||
Start() | ||
|
||
// Shutdown the EEBUS service | ||
Shutdown() | ||
|
||
// Add a use case implementation | ||
AddUseCase(usecase UseCaseInterface) | ||
} | ||
|
||
// Implemented by each UseCase | ||
type UseCaseInterface interface { | ||
// provide the usecase name | ||
UseCaseName() model.UseCaseNameType | ||
|
||
// add the features | ||
AddFeatures() | ||
AddUseCases() | ||
|
||
// add the usecase | ||
AddUseCase() | ||
|
||
// returns if the entity supports the usecase | ||
// | ||
// possible errors: | ||
// - ErrDataNotAvailable if that information is not (yet) available | ||
// - and others | ||
IsUseCaseSupported(remoteEntity spineapi.EntityRemoteInterface) (bool, error) | ||
} | ||
|
||
// interface for informing the cem about specific events | ||
// for each supported usecase | ||
// | ||
// UseCaseEventType values can be found in the api definition of each | ||
// supported usecase | ||
// | ||
// implemented by the actual CEM, used by UCEvseCCInterface implementation | ||
type UseCaseEventReaderInterface interface { | ||
// Inform about a new usecase specific event | ||
SpineEvent(ski string, entity spineapi.EntityRemoteInterface, event UseCaseEventType) | ||
} |
Oops, something went wrong.