connectionmgr.pp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. {$INLINE ON}
  2. {$MACRO ON}
  3. {$define Rsc := }
  4. (***********************************************************************
  5. *
  6. * Copyright (c) 1998-2000 Palm, Inc. or its subsidiaries.
  7. * All rights reserved.
  8. *
  9. * File: ConnectionMgr.h
  10. *
  11. * Release: Palm OS SDK 4.0 (63220)
  12. *
  13. * Description:
  14. * Connection Manager Interface. The Connection Manager allows
  15. * other applications to access, add, and delete connection profiles
  16. * contained in the Connection Panel.
  17. *
  18. * History:
  19. * 8/19/98 ADH Initial Implementation
  20. * 03/01/2000 PPL Rewrite API for New Connection Manager
  21. * 03/30/2000 PPL Constant change from cncXXXX to kCncXXXX
  22. * and # defining old names (cncXXXX) for compatibility.
  23. * 10/19/00 PPL Update the header with GuideLines
  24. * 10/20/00 PPL Remove CncProfileBroacast - The notification it sent
  25. * is always in usage.
  26. * 10/23/00 PPL Update Connection Manager API
  27. * 11/06/2000 PPL Use the CncProfileId abstract type for profileIDs
  28. *
  29. ***********************************************************************)
  30. unit connectionmgr;
  31. interface
  32. uses palmos, coretraps, errorbase, datamgr, modemmgr;
  33. (***********************************************************************
  34. * Definition
  35. ***********************************************************************)
  36. type
  37. CncProfileID = UInt32;
  38. (***********************************************************************
  39. * Connection Profile Broadcasting
  40. ***********************************************************************)
  41. const
  42. kCncProfileNotifyCurrentVersion = 1;
  43. type
  44. CncProfileNotifyDetailsTag = record
  45. // In: version - This definition is version 1 (kCncProfileNotifyCurrentVersion)
  46. // later versions should include all the fields of version 1 plus
  47. // any additional fields of CncProfileNotifyDetailsType
  48. version: UInt16;
  49. // In: Broacasted Profile ID
  50. profileID: CncProfileID;
  51. // In: Device Kind of the profile
  52. deviceKind: UInt16;
  53. // In: Resquested Action
  54. request: UInt16;
  55. end;
  56. CncProfileNotifyDetailsType = CncProfileNotifyDetailsTag;
  57. (***********************************************************************
  58. * Constants
  59. ***********************************************************************)
  60. const
  61. kCncProfileInvalidId = CncProfileID(0);
  62. // Request's modifiers flags
  63. const
  64. kCncNotifyBecomeCurrentModifier = $8000; // Change the Client current settings
  65. kCncNotifyAlertUserModifier = $4000; // ask for Client UI
  66. kNotifyRequestMofifiersMask = kCncNotifyBecomeCurrentModifier or kCncNotifyAlertUserModifier;
  67. // Requests
  68. kCncNotifyCreateRequest = 1; // the profile has been created
  69. kCncNotifyModifyRequest = 2; // the profile has been modified
  70. kCncNotifyDeleteRequest = 3; // the profile has been deleted
  71. kCncNotifyUpdateListRequest = 4; // the profile has been deleted
  72. (***********************************************************************
  73. * Connection Profile ParamID Definition Macros and Constants
  74. ***********************************************************************)
  75. const
  76. kCncParamOSRange = $0000; // bit #15 set at 0
  77. kCncParamThirdPartiesRange = $8000; // bit #15 set at 1
  78. kCncParamFixedLength = $0000; // bit #14 set to 0
  79. kCncParamVariableLength = $4000; // bit #14 set to 1
  80. kCncParamIDMask = $07FF; // bit #0 to #10 set to 1 (11 bits)
  81. kCncParamTypeMask = $7800; // bit #11 to #14 set to 1 (4 bits)
  82. // parameter type definition macros
  83. kCncParamFixedLen = $00; // higth bit of 4 set to 0
  84. kCncParamVariableLen = $08; // higth bit of 4 set to 1
  85. //#define CncDefineParameterType( variableBit , typeOrder) ( ( (variableBit) | (typeOrder) ) << 11)
  86. // bit number is comprised between 0 and 31
  87. // #define CncDefineSystemFlagMask(bitnum) (1 << (bitnum))
  88. const
  89. kCncParamSystemFlag = (kCncParamFixedLen or 0) shl 11; // 0x0000
  90. kCncParamUInt8 = (kCncParamFixedLen or 1) shl 11; // 0x0800
  91. kCncParamUInt16 = (kCncParamFixedLen or 2) shl 11; // 0x1000
  92. kCncParamUInt32 = (kCncParamFixedLen or 3) shl 11; // 0x1800
  93. // [free slot from 4 to 7]
  94. kCncParamUInt8Size = SizeOf(UInt8);
  95. kCncParamUInt16Size = SizeOf(UInt16);
  96. kCncParamUInt32Size = SizeOf(UInt32);
  97. kCncParamSystemFlagSize = kCncParamUInt8Size;
  98. kCncParamString = (kCncParamVariableLen or 1) shl 11; // 0x4800
  99. kCncParamBuffer = (kCncParamVariableLen or 2) shl 11; // 0x5000
  100. // [free slot from 3 to 7]
  101. // full Parameter ID definition macro
  102. (*
  103. #define CncDefineParamID(parameterRange, parameterType, parameterID) ( (parameterRange) | (parameterType) | (parameterID) )
  104. #define CncIsSystemRange(parameterID) ( ( (parameterID) & kCncParamThirdPartiesRange) != kCncParamThirdPartiesRange)
  105. #define CncIsThirdPartiesRange(parameterID) ( ( (parameterID) & kCncParamThirdPartiesRange ) == kCncParamThirdPartiesRange)
  106. #define CncIsFixedLengthParamType(parameterID) ( ( (parameterID) & kCncParamVariableLength) != kCncParamVariableLength )
  107. #define CncIsVariableLengthParamType(parameterID) ( ( (parameterID) & kCncParamVariableLength ) == kCncParamVariableLength)
  108. #define CncGetTrueParamID(parameterID) ( (parameterID) & kCncParamIDMask)
  109. #define CncGetParamType(parameterID) ( (parameterID) & kCncParamTypeMask)
  110. #define CncIsSystemFlags(parameterID) ( ! (CncGetParamType( (parameterID) ) ) )
  111. #define CncGetSystemFlagBitnum(parameterID) CncGetTrueParamID(parameterID)
  112. *)
  113. // Some tests
  114. (***********************************************************************
  115. * Cnc Manager Feature
  116. ***********************************************************************)
  117. const
  118. kCncFtrCncMgrCreator = Rsc('cmgr');
  119. kCncFtrCncMgrVersion = 0;
  120. kCncMgrVersion = $00040001; // 4.0 = 4->high 0->low
  121. // feature index 1 and 2 are reserved
  122. (***********************************************************************
  123. * Parameter size values
  124. ***********************************************************************)
  125. const
  126. // 22 for compatibility
  127. kCncProfileNameSize = 22;
  128. // 81 defined in ModemMgr.h
  129. kCncProfileUsualInitStringSize = mdmCmdBufSize;
  130. // 81 defined in ModemMgr.h
  131. kCncProfileClassicResetStringSize = mdmCmdSize; // Old size was 8
  132. kCncProfileUsualResetStringSize = mdmCmdBufSize;
  133. (***********************************************************************
  134. * Parameters values
  135. ***********************************************************************)
  136. // device kinds
  137. kCncDeviceKindSerial = 0;
  138. kCncDeviceKindModem = 1;
  139. kCncDeviceKindPhone = 2;
  140. kCncDeviceKindLocalNetwork = 3;
  141. // Old flow controls
  142. kCncFlowControlAuto = 0;
  143. kCncFlowControlOFF = 1;
  144. kCncFlowControlON = 2;
  145. kCncProfileVersion = 4;
  146. (***********************************************************************
  147. * Error Codes
  148. ***********************************************************************)
  149. kCncErrAddProfileFailed = cncErrorClass or $01; // Add profile attempt failed
  150. kCncErrProfileListFull = cncErrorClass or $02; // Add attempt failed because the
  151. // profile list is full.
  152. kCncErrGetProfileFailed = cncErrorClass or $03; // Get profile attempt failed
  153. kCncErrDBAccessFailed = cncErrorClass or $04; // Connection database not found or access failed
  154. kCncErrGetProfileListFailed = cncErrorClass or $05; // Could not get profile list
  155. kCncErrProfileReadOnly = cncErrorClass or $06; // The profile can not be altered
  156. kCncErrProfileNotFound = cncErrorClass or $07; // The profile could not be found
  157. // New API error code
  158. kCncErrProfileParamNotFound = cncErrorClass or $08; // The profile parameter could not be found
  159. kCncErrProfileParamReadOnly = cncErrorClass or $09; // The profile parameter can only be read
  160. kCncErrProfileParamNameHasChange = cncErrorClass or $0a; // The profile parameter Name has been modified to be unique
  161. kCncErrProfileGetParamFailed = cncErrorClass or $0b; // failed to get a parameter in a profile
  162. kCncErrProfileSetParamFailed = cncErrorClass or $0c; // failed to Set a parameter in a profile
  163. kCncErrProfileBadParamSize = cncErrorClass or $0d; // failed to Set a parameter in a profile
  164. kCncErrProfileBadSystemFlagBitnum = cncErrorClass or $0e; // the bit num of a system flag is not comprise between 0 and 31
  165. (***********************************************************************
  166. * Parameters ID and Sizes
  167. ***********************************************************************)
  168. const
  169. // void param has a size of zero bytes
  170. kCncNoParam = 0;
  171. kCncNoParamSize = 0;
  172. // 22 bytes limited - for compatibility
  173. kCncParamName = kCncParamOSRange or kCncParamString or 1;
  174. kCncParamNameMaxSize = kCncProfileNameSize;
  175. kCncParamPort = kCncParamOSRange or kCncParamUInt32 or 2;
  176. kCncParamPortSize = kCncParamUInt32Size;
  177. kCncParamBaud = kCncParamOSRange or kCncParamUInt32 or 3;
  178. kCncParamBaudSize = kCncParamUInt32Size;
  179. kCncParamVolume = kCncParamOSRange or kCncParamUInt16 or 4;
  180. kCncParamVolumeSize = kCncParamUInt16Size;
  181. kCncParamFlowControl = kCncParamOSRange or kCncParamUInt16 or 5;
  182. kCncParamFlowControlSize = kCncParamUInt16Size;
  183. // New piece of info - communication time Out (CTS)
  184. kCncParamTimeOut = kCncParamOSRange or kCncParamUInt32 or 6;
  185. kCncParamTimeOutSize = kCncParamUInt32Size;
  186. kCncParamInitString = kCncParamOSRange or kCncParamString or 7;
  187. kCncParamInitStringMaxSize = mdmCmdBufSize;
  188. kCncParamResetString = kCncParamOSRange or kCncParamString or 8;
  189. kCncParamResetStringMaxSize = mdmCmdBufSize;
  190. // New piece of info - extented device kind cf kCncDeviveXXX after
  191. kCncParamDeviceKind = kCncParamOSRange or kCncParamUInt16 or 9;
  192. kCncParamDeviceKindSize = kCncParamUInt16Size;
  193. // country index for the profile
  194. kCncParamCountryIndex = kCncParamOSRange or kCncParamUInt16 or 11;
  195. kCncParamCountryIndexSize = kCncParamUInt16Size;
  196. // dialing mode, old pulse param
  197. kCncParamDialingMode = kCncParamOSRange or kCncParamUInt8 or 12;
  198. kCncParamDialingModeSize = kCncParamUInt8Size;
  199. kCncParamVersion = kCncParamOSRange or kCncParamUInt8 or 13;
  200. kCncParamVersionSize = kCncParamUInt8Size;
  201. kCncParamReceiveTimeOut = kCncParamOSRange or kCncParamUInt32 or 14;
  202. kCncParamReceiveTimeOutSize = kCncParamUInt32Size;
  203. // International Reset string (count [strings])
  204. kCncParamIntlModemResetStringList = kCncParamOSRange or kCncParamBuffer or 15;
  205. // International country string (count [strings])
  206. kCncParamIntlModemCountryStringList = kCncParamOSRange or kCncParamBuffer or 16;
  207. // special parameters : system flags
  208. // the meaning of these parameters is for the connection panel
  209. // up to 32 flags system flag will be possible
  210. // bit numbering
  211. kCncParamReadOnlyBit = 0;
  212. kCncParamInvisibleBit = 1;
  213. kCncParamNonEditableBit = 2;
  214. kCncParamNoDetailsBit = 3;
  215. kCncParamLockedBit = 4;
  216. kCncParamReservedBit5 = 5;
  217. kCncParamReservedBit6 = 6;
  218. kCncParamReservedBit7 = 7;
  219. kCncParamReservedBit8 = 8;
  220. kCncParamReservedBit9 = 9;
  221. kCncParamReservedBit10 = 10;
  222. kCncParamReservedBit11 = 11;
  223. kCncParamReservedBit12 = 12;
  224. kCncParamReservedBit13 = 13;
  225. kCncParamReservedBit14 = 14;
  226. kCncParamReservedBit15 = 15;
  227. kCncParamSystemBit16 = 16;
  228. kCncParamSystemBit17 = 17;
  229. kCncParamReservedBit18 = 18;
  230. kCncParamReservedBit19 = 19;
  231. kCncParamReservedBit20 = 20;
  232. kCncParamReservedBit21 = 21;
  233. kCncParamReservedBit22 = 22;
  234. kCncParamReservedBit23 = 23;
  235. kCncParamReservedBit24 = 24;
  236. kCncParamReservedBit25 = 25;
  237. kCncParamReservedBit26 = 26;
  238. kCncParamReservedBit27 = 27;
  239. kCncParamReservedBit28 = 28;
  240. kCncParamReservedBit29 = 29;
  241. kCncParamReservedBit30 = 30;
  242. kCncParamReservedBit31 = 31;
  243. kCncParamSystemFlagsNum = $07FF;
  244. // the following parameter handles the system flags as an UInt32 integer (all the flags, at once)
  245. kCncParamSystemFlags = kCncParamOSRange or kCncParamSystemFlag or kCncParamSystemFlagsNum;
  246. kCncParamSystemFlagsSize = kCncParamUInt32Size;
  247. // bit parameters definition : to handle flags bit per bit
  248. kCncParamReadOnly = kCncParamOSRange or kCncParamSystemFlag or 0;
  249. kCncParamReadOnlySize = kCncParamSystemFlagSize;
  250. kCncParamInvisible = kCncParamOSRange or kCncParamSystemFlag or 1;
  251. kCncParamInvisibleSize = kCncParamSystemFlagSize;
  252. kCncParamNonEditable = kCncParamOSRange or kCncParamSystemFlag or 2;
  253. kCncParamNonEditableSize = kCncParamSystemFlagSize;
  254. kCncParamNoDetails = kCncParamOSRange or kCncParamSystemFlag or 3;
  255. kCncParamNoDetailsSize = kCncParamSystemFlagSize;
  256. kCncParamLocked = kCncParamOSRange or kCncParamSystemFlag or 4;
  257. kCncParamLockedSize = kCncParamSystemFlagSize;
  258. (* Bluetooth parameter IDs - New pieces of info *)
  259. // 48 bit blue Tooth address (BD_ADDR) - This address is derived from the IEEE802 standard
  260. kCncParamBluetoothDeviceAddr = kCncParamOSRange or kCncParamBuffer or 50;
  261. kCncParamBluetoothDeviceAddrSize = 8;
  262. // Bluetooth device name - 248 bytes coded according to the UTF-8 standard at max + NULL terninaison
  263. kCncParamBluetoothDeviceName = kCncParamOSRange or kCncParamString or 51;
  264. kCncParamBluetoothDeviceNameMaxSize = 249;
  265. // Caution : system parameter range ID from 80 to 200 are reserved for telephony services
  266. // and should never be reused by any other component
  267. (***********************************************************************
  268. * Telephony Manager parameter
  269. ***********************************************************************)
  270. (* TT-AT specific parameters *)
  271. // New piece gathering several parts (uses the serial manager flags cf SerialMgr.h )
  272. kCncParamSerialPortFlags = kCncParamOSRange or kCncParamUInt32 or 84;
  273. kCncParamSerialPortFlagsSize = kCncParamUInt32Size;
  274. // Telephony Task type - mobile telephony
  275. kCncParamTTType = kCncParamOSRange or kCncParamUInt32 or 90;
  276. kCncParamTTTypeSize = kCncParamUInt32Size;
  277. // Telephony Task Creator - mobile telephony
  278. kCncParamTTCreator = kCncParamOSRange or kCncParamUInt32 or 91;
  279. kCncParamTTCreatorSize = kCncParamUInt32Size;
  280. // Phone Driver Name - mobile telephony
  281. kCncParam_PSDName = kCncParamOSRange or kCncParamString or 92;
  282. kCncParam_PSDNameSize = dmDBNameLength;
  283. // Phone Driver creator - mobile telephony
  284. kCncParam_PSDCreator = kCncParamOSRange or kCncParamUInt32 or 93;
  285. kCncParam_PSDCreatorSize = kCncParamUInt32Size;
  286. // Phone Driver type - mobile telephony
  287. kCncParam_PSDType = kCncParamOSRange or kCncParamUInt32 or 94;
  288. kCncParam_PSDTypeSize = kCncParamUInt32Size;
  289. // Phone Driver Param Buffer - mobile telephony
  290. kCncParam_PSDParameterBuffer = kCncParamOSRange or kCncParamBuffer or 100;
  291. (***********************************************************************
  292. * New Connection Manager trap selectors
  293. ***********************************************************************)
  294. sysTrapCncMgrProfileSettingGet = 1;
  295. sysTrapCncMgrProfileSettingSet = 2;
  296. sysTrapCncMgrProfileGetCurrent = 3;
  297. sysTrapCncMgrProfileSetCurrent = 4;
  298. sysTrapCncMgrProfileGetIDFromName = 5;
  299. sysTrapCncMgrProfileCreate = 6;
  300. sysTrapCncMgrProfileDelete = 7;
  301. sysTrapCncMgrProfileGetIDFromIndex = 8;
  302. sysTrapCncMgrProfileGetIndex = 9;
  303. sysTrapCncMgrProfileCount = 10;
  304. sysTrapCncMgrProfileOpenDB = 11;
  305. sysTrapCncMgrProfileCloseDB = 12;
  306. (***********************************************************************
  307. * Connection Manager Library Macros
  308. ***********************************************************************)
  309. (***********************************************************************
  310. * New Connection Mgr API
  311. ***********************************************************************)
  312. function CncProfileSettingGet(profileId: CncProfileID; paramId: UInt16; paramBufferP: Pointer; var ioParamSizeP: UInt16): Err;
  313. function CncProfileSettingSet(iProfileId: CncProfileID; paramId: UInt16; const paramBufferP: Pointer; paramSize: UInt16): Err;
  314. function CncProfileSetCurrent(profileId: CncProfileID): Err;
  315. function CncProfileGetCurrent(var profileIdP: CncProfileID): Err;
  316. function CncProfileGetIDFromName(const profileNameP: PChar; var profileIdP: CncProfileID): Err;
  317. function CncProfileCreate(var profileIdP: CncProfileID): Err;
  318. function CncProfileDelete(profileId: CncProfileID): Err;
  319. function CncProfileGetIDFromIndex(index: UInt16; var profileIdP: CncProfileID): Err;
  320. function CncProfileGetIndex(profileId: CncProfileID; var indexP: UInt16): Err;
  321. function CncProfileCount(var profilesCountP: UInt16): Err;
  322. function CncProfileOpenDB: Err;
  323. function CncProfileCloseDB: Err;
  324. (***********************************************************************
  325. * Old Connection Mgr API, For compatibility only
  326. ***********************************************************************)
  327. const
  328. // Maximum size for a Connection Profile Name
  329. cncProfileNameSize = 22;
  330. // Error Codes
  331. cncErrAddProfileFailed = cncErrorClass or 1; // Add profile attempt failed
  332. cncErrProfileListFull = cncErrorClass or 2; // Add attempt failed because the
  333. // profile list is full.
  334. cncErrGetProfileFailed = cncErrorClass or 3; // Get profile attempt failed
  335. cncErrConDBNotFound = cncErrorClass or 4; // Connection database not found
  336. cncErrGetProfileListFailed = cncErrorClass or 5; // Could not get profile list
  337. cncErrProfileReadOnly = cncErrorClass or 6; // The profile can not be altered
  338. cncErrProfileNotFound = cncErrorClass or 7; // The profile could not be found
  339. // Functions
  340. function CncGetProfileList(var nameListPPP: PCharPtr; var countP: UInt16): Err; syscall sysTrapCncGetProfileList;
  341. function CncGetProfileInfo(name: PChar; var port, baud: UInt32; var volume, handShake: UInt16;
  342. initString: PChar; var resetString: Char; var isModem, isPulse: Boolean): Err; syscall sysTrapCncGetProfileInfo;
  343. function CncAddProfile(name: PChar; port, baud: UInt32; volum, handShake: UInt16;
  344. const initString, resetString: PChar; isMode, isPulse: Boolean): Err; syscall sysTrapCncAddProfile;
  345. function CncDeleteProfile(const name: PChar): Err; syscall sysTrapCncDeleteProfile;
  346. implementation
  347. function __CncProfileSettingGet(profileId: CncProfileID; paramId: UInt16; paramBufferP: Pointer; var ioParamSizeP: UInt16): Err; syscall sysTrapCncMgrDispatch;
  348. function __CncProfileSettingSet(iProfileId: CncProfileID; paramId: UInt16; const paramBufferP: Pointer; paramSize: UInt16): Err; syscall sysTrapCncMgrDispatch;
  349. function __CncProfileSetCurrent(profileId: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  350. function __CncProfileGetCurrent(var profileIdP: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  351. function __CncProfileGetIDFromName(const profileNameP: PChar; var profileIdP: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  352. function __CncProfileCreate(var profileIdP: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  353. function __CncProfileDelete(profileId: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  354. function __CncProfileGetIDFromIndex(index: UInt16; var profileIdP: CncProfileID): Err; syscall sysTrapCncMgrDispatch;
  355. function __CncProfileGetIndex(profileId: CncProfileID; var indexP: UInt16): Err; syscall sysTrapCncMgrDispatch;
  356. function __CncProfileCount(var profilesCountP: UInt16): Err; syscall sysTrapCncMgrDispatch;
  357. function __CncProfileOpenDB: Err; syscall sysTrapCncMgrDispatch;
  358. function __CncProfileCloseDB: Err; syscall sysTrapCncMgrDispatch;
  359. function CncProfileSettingGet(profileId: CncProfileID; paramId: UInt16; paramBufferP: Pointer; var ioParamSizeP: UInt16): Err;
  360. begin
  361. asm
  362. move.l #$sysTrapCncMgrProfileSettingGet, D2
  363. end;
  364. CncProfileSettingGet := __CncProfileSettingGet(profileId, paramId, paramBufferP, ioParamSizeP);
  365. end;
  366. function CncProfileSettingSet(iProfileId: CncProfileID; paramId: UInt16; const paramBufferP: Pointer; paramSize: UInt16): Err;
  367. begin
  368. asm
  369. move.l #$sysTrapCncMgrProfileSettingSet, D2
  370. end;
  371. CncProfileSettingSet := __CncProfileSettingSet(iProfileId, paramId, paramBufferP, paramSize);
  372. end;
  373. function CncProfileSetCurrent(profileId: CncProfileID): Err;
  374. begin
  375. asm
  376. move.l #$sysTrapCncMgrProfileSetCurrent, D2
  377. end;
  378. CncProfileSetCurrent := __CncProfileSetCurrent(profileId);
  379. end;
  380. function CncProfileGetCurrent(var profileIdP: CncProfileID): Err;
  381. begin
  382. asm
  383. move.l #$sysTrapCncMgrProfileGetCurrent, D2;
  384. end;
  385. CncProfileGetCurrent := __CncProfileGetCurrent(profileIdP);
  386. end;
  387. function CncProfileGetIDFromName(const profileNameP: PChar; var profileIdP: CncProfileID): Err;
  388. begin
  389. asm
  390. move.l #$sysTrapCncMgrProfileGetIDFromName, D2;
  391. end;
  392. CncProfileGetIDFromName := __CncProfileGetIDFromName(profileNameP, profileIdP);
  393. end;
  394. function CncProfileCreate(var profileIdP: CncProfileID): Err;
  395. begin
  396. asm
  397. move.l #$sysTrapCncMgrProfileCreate, D2;
  398. end;
  399. CncProfileCreate := __CncProfileCreate(profileIdP);
  400. end;
  401. function CncProfileDelete(profileId: CncProfileID): Err;
  402. begin
  403. asm
  404. move.l #$sysTrapCncMgrProfileDelete, D2;
  405. end;
  406. CncProfileDelete := __CncProfileDelete(profileId);
  407. end;
  408. function CncProfileGetIDFromIndex(index: UInt16; var profileIdP: CncProfileID): Err;
  409. begin
  410. asm
  411. move.l #$sysTrapCncMgrProfileGetIDFromIndex, D2;
  412. end;
  413. CncProfileGetIDFromIndex := __CncProfileGetIDFromIndex(index, profileIdP);
  414. end;
  415. function CncProfileGetIndex(profileId: CncProfileID; var indexP: UInt16): Err;
  416. begin
  417. asm
  418. move.l #$sysTrapCncMgrProfileGetIndex, D2;
  419. end;
  420. CncProfileGetIndex := __CncProfileGetIndex(profileID, indexP);
  421. end;
  422. function CncProfileCount(var profilesCountP: UInt16): Err;
  423. begin
  424. asm
  425. move.l #$sysTrapCncMgrProfileCount, D2
  426. end;
  427. CncProfileCount := __CncProfileCount(profilesCountP);
  428. end;
  429. function CncProfileOpenDB: Err;
  430. begin
  431. asm
  432. move.l #$sysTrapCncMgrProfileOpenDB, D2;
  433. end;
  434. CncProfileOpenDB := __CncProfileOpenDB;
  435. end;
  436. function CncProfileCloseDB: Err;
  437. begin
  438. asm
  439. move.l #$sysTrapCncMgrProfileCloseDB, D2;
  440. end;
  441. CnCProfileCloseDB := __CncProfileCloseDB;
  442. end;
  443. end.