Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
#include <stdio.h>
#include <conio.h>
#define _CLIENT_MAIN
#include "adjust.h"
#include "mostdef1.h"
#include "mostns1.h"
#include "mostnetsdll.h"
BYTE DeviceMode = SLAVE;
// Send an eject to MOSTMediaPlayer on Address 0x190
void CtrlSample(void)
{
pTCtrlTx ptx;
ptx = CtrlGetTxPtr();
if (ptx)
{
ptx->Priority = 0x00;
ptx->MsgType = 0x00;
ptx->Tgt_Adr_H = 0x01;
ptx->Tgt_Adr_L = 0x90;
ptx->Length = 6;
ptx->Data[0] = 0x3F; // FBlock
ptx->Data[1] = 0x00; // Inst
ptx->Data[2] = 0x20; // Func
ptx->Data[3] = 0x00; // Func + OpType
ptx->Data[4] = 0x01; // Length
ptx->Data[5] = 0x04;
CtrlSend(ptx);
}
}
// Send an eject to MOSTMediaPlayer on Address 0x190
void MsgSample(void)
{
pTMsgTx ptx;
ptx = MsgGetTxPtr();
if (ptx)
{
ptx->Priority = 0x00;
ptx->Tgt_Adr = 0x0190;
ptx->FBlock_ID = 0x3F; // FBlock
ptx->Inst_ID = 0x00; // Inst
ptx->Func_ID = 0x200; // Func
ptx->Operation = 0x0; // OpType
ptx->Length = 0x01; // Length
ptx->Data[0] = 0x04; // Eject
MsgSend(ptx);
}
}
void main(int argc, char *argv[])
{
short ret;
int j;
int key;
BusType = BUS_TYPE_PCI; // default
InstID = 0; // default
UseMsgInterface = FALSE;
strcpy(ClientName, "Client1"); // only needed by OptoLyzer4MOST Prof. (Simulation)
if (argc > 1)
{
for (j = 1; j < argc; j++)
{
if (!strcmp(argv[j], "-d"))
{
if (!strcmp(argv[j+1], "ISA"))
BusType = BUS_TYPE_ISA;
if (!strcmp(argv[j+1], "PCI"))
BusType = BUS_TYPE_PCI;
if (!strcmp(argv[j+1], "SER"))
{
BusType = BUS_TYPE_SER;
UseMsgInterface = TRUE;
}
}
if (!strcmp(argv[j], "-i"))
{
InstID = atoi(argv[j+1]);
}
if (!strcmp(argv[j], "-m"))
{
DeviceMode = MASTER;
}
}
}
ret = OpenNetServices();
if (ret < 0)
{
printf("OpenNetServices failed: %d\n", ret);
printf("Press key to exit\n");
getch();
return;
}
MostStartUp(DeviceMode, RESET);
do
{
printf("KeyCodes:\n");
printf(" <ESC> to exit\n");
printf(" <C> Send CtrlMsg using CMS\n");
printf(" <M> Send CtrlMsg using AMS\n");
key = getch();
switch(key)
{
case 'c':
case 'C':
printf("Sending Ctrl Message (CMS) to 0x190 (Eject)\n");
CtrlSample();
break;
case 'm':
case 'M':
printf("Sending Ctrl Message (AMS) to 0x190 (Eject)\n");
MsgSample();
break;
}
} while(key != 0x1B);
CloseNetServices();
}
void PrintDebug(char *str)
{
printf(str);
printf("\n");
}
\