Gestire manualmente il POS per i dispositivi .NET (documentazione POS per .NET v1.14 SDK)

È possibile eseguire manualmente la maggior parte delle attività di gestione dei dispositivi Microsoft Point of Service per NET (POS per .NET) senza usare Gestione dispositivi POS (posdm.exe).

Gestione manuale di POS per dispositivi .NET

È possibile modificare manualmente il file XML di configurazione POS per .NET per replicare la maggior parte delle funzionalità disponibili con posdm.exe.

È possibile trovare il percorso del file XML di configurazione POS per .NET nel valore Configuration nella chiave del Registro di sistema HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\POSfor.NET.

Il percorso predefinito del file di configurazione è *%ProgramData%\*Microsoft\Point of Service\Configuration\Configuration.xml

Nella tabella seguente sono elencati posdm.exe comandi e il codice XML equivalente che è necessario aggiungere al file xml di configurazione.

Comando Posdm.exe

Descrizione

Configuration.xml

Esempio

ADDDEVICE

Aggiungere un dispositivo fisico non Plug and Play.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="yes" PnP="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm ADDDEVICE COM1 /SONAME:"Microsoft Msr Simulator" /Type:msr

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM1" Enabled="yes" PnP="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

ADDNAME

Aggiungere un nome all'elenco di nomi di un dispositivo.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="yes" PnP="no">
      <LogicalName Name="[Device Name]" />
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm ADDNAME MyName /SONAME:"Microsoft Msr Simulator" /Path:COM1

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM1" Enabled="yes" PnP="no">
     <LogicalName Name="MyName" />
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

ADDPROPERTY

Aggiungere una proprietà a un dispositivo.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="yes" PnP="no">
      <Property Name="[Property Name]" Value="[Property Value]" />
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm addproperty MyProperty MyValue /Name:MyName

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM1" Enabled="yes" PnP="no">
     <LogicalName Name="MyName" />
     <Property Name="MyProperty" Value="MyValue" />
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

DELETEDEVICE

Eliminare un dispositivo fisico non Plug and Play.

Rimuovere il nodo <Dispositivo>.

DELETENAME

Eliminare un nome dall'elenco di nomi di un dispositivo

Rimuovere il nodo <LogicalName>.

DELETEPROPERTY

Eliminare una proprietà da un dispositivo.

Rimuovere il nodo <Proprietà>.

DISABLE

Disabilitare un SO in un dispositivo POS.

Impostare Enabled="no" e Default="no" nel nodo <Dispositivo>.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="no" PnP="no" Default="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm disable /Path:COM1

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM1" Enabled="no" PnP="no" Default="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

ENABLE

Abilitare un SO in un dispositivo POS.

Impostare Enabled="yes" nel nodo <Dispositivo>.

INFO

Visualizza le proprietà del dispositivo.

N/D

LISTDEVICES

Elencare i dispositivi POS nell'<host> di destinazione.

N/D

LISTNAMES

Elenca i nomi associati ai dispositivi POS.

N/D

LISTPROPS

Elencare le proprietà associate a un dispositivo.

N/D

LISTSOS

Elencare gli oggetti servizio POS nell'<host> di destinazione.

I percorsi di ricerca dell'oggetto servizio sono tutti i valori nella chiave del Registro di sistema:

HKLM\Software\Wow6432Node\Posfor.NET\ControlAssemblies

Il percorso di ricerca predefinito è:

%CommonProgramFiles(x86)%\Microsoft Shared\Point Of Service\Control Assemblies\

POS per .NET tenterà di caricare tutte le DLL dell'oggetto servizio trovate in questi percorsi.

SETDEFAULT

Impostare un dispositivo come predefinito del suo <tipo>.

Impostare Default="yes" nel nodo <Dispositivo>.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="yes" PnP="no" Default="yes">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm SETDEFAULT ON /Path:COM1

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM1" Enabled="yes" PnP="no"  Default="yes">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

SETPATH

Imposta il <percorso> del dispositivo POS non Plug and Play.

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="[Service Object Name]" Type="[Device Type]">
    <Device HardwarePath="[Hardware Path]" Enabled="yes" PnP="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>

Comando Posdm.exe:

Posdm SETPATH COM2 /SONAME:"Microsoft Msr Simulator" /Type:msr

Configuration.xml:

<PointOfServiceConfig Version="1.0">
  <ServiceObject Name="Microsoft Msr Simulator" Type="Msr">
    <Device HardwarePath="COM2" Enabled="yes" PnP="no">
    </Device>
  </ServiceObject>
</PointOfServiceConfig>