Scentient Escents Unity API
Loading...
Searching...
No Matches
Scentient.ScentientDevice Class Reference

Use this component to connect to the Scentient eScents peripheral. Add to your scene, and configure to your needs. More...

Inheritance diagram for Scentient.ScentientDevice:

Classes

struct  PodInfoStruct
 
class  ScentMessage
 
struct  ScentMessageStruct
 

Public Types

enum  States {
  None , Scan , ScanRSSI , ReadRSSI ,
  Connect , RequestMTU , Subscribe , Unsubscribe ,
  Disconnect , Ready
}
 

Public Member Functions

void Connect ()
 
async Task< string[]> GetChannelScentNamesAsync ()
 
string[] GetChannelScentNames ()
 
void Disconnect ()
 
void SendScentMessage (byte channel, byte intensity, UInt16 duration)
 Emits a scent from one of the 4 scent emitters, with the provided intensity and duration.
 
void SendScentMessage (int channel, float intensity, float duration)
 
bool EmitScent (string scentName, float duration)
 Emits a scent for a fixed period of time. Any scent being emitted can be stopped by calling this method with a duration of 0.
 
bool EmitScent (string scentName, float intensity, float duration)
 
void SendScentMessage (ScentMessage scentMessage)
 
Dictionary< short, string > GetScentDict ()
 
void SetChannelScent (int channelToSet, short scentId)
 

Public Attributes

UnityEvent OnConnectedEvent
 
readonly ScentTable scentTable = new ScentTable()
 
bool verbose
 Set this property to true to get additional information in the console about communicaiton to the scentient peripheral.
 
bool reconnectToLastDevice = true
 
bool autoConnectOnStart
 Automatically calls Connect as soon as possible after starting. This should also trigger runtime permission requests first, if autoRequestPermissionsOnConnect is enabled.
 
bool autoRequestPermissionsOnConnect = true
 When Connect is called, the attempt to connect is defered, and the runtime permissions dialog presented to the user is neccessary.
 
bool persistenAcrossScenes = false
 If communication with the Scentient peripheral is required across scenes, enable this property.
 

Properties

string StatusMessage [get]
 
string[] ChannelScentNames [get]
 
States State [get]
 

Events

Action< string > OnStatusChangedEvent
 
Action< States > OnStateChangedEvent
 
Action< bool > OnButtonChangedEvent
 
Action< int, string > OnChannelScentsUpdatedEvent
 

Detailed Description

Use this component to connect to the Scentient eScents peripheral. Add to your scene, and configure to your needs.

Member Function Documentation

◆ EmitScent() [1/2]

bool Scentient.ScentientDevice.EmitScent ( string scentName,
float duration )
inline

Emits a scent for a fixed period of time. Any scent being emitted can be stopped by calling this method with a duration of 0.

Parameters
scentNameThe name of the scent, can include spaces, should be one of the names in the following table https://api.scentient.tech/scent-table_en.csv
durationduration in seconds
Returns

◆ EmitScent() [2/2]

bool Scentient.ScentientDevice.EmitScent ( string scentName,
float intensity,
float duration )
inline
Parameters
scentNameThe name of the scent, can include spaces, should be one of the names in the following table https://api.scentient.tech/scent-table_en.csv
intensityValue from 0 to 1
durationduration in seconds
Returns

◆ SendScentMessage() [1/2]

void Scentient.ScentientDevice.SendScentMessage ( byte channel,
byte intensity,
UInt16 duration )
inline

Emits a scent from one of the 4 scent emitters, with the provided intensity and duration.

Parameters
channelchannel value 1-6
intensityvalue between 0-255, 0 being off
durationin milliseconds

◆ SendScentMessage() [2/2]

void Scentient.ScentientDevice.SendScentMessage ( int channel,
float intensity,
float duration )
inline

Emits a scent from one of the 6 scent emitters, with the provided intensity and duration

Parameters
channelchannel value 1-6
intensityvalue between 0-255, 0 being off
durationin milliseconds

The documentation for this class was generated from the following file: