machinekit / machinekit-hal

Universal framework for machine control based on Hardware Abstraction Layer principle
https://www.machinekit.io
Other
108 stars 62 forks source link

Cannot delete a ring with halcmd #86

Open ArcEye opened 6 years ago

ArcEye commented 6 years ago

Issue by cdsteinkuehler Fri Oct 14 00:11:52 2016 Originally opened as https://github.com/machinekit/machinekit/issues/1076


I'm not sure I completely understand the syntax, but if I'm not confused it doesn't look like you can delete a ring with halcmd once it's created:

machinekit@beaglebone:~$ halcmd newring test 1024
machinekit@beaglebone:~$ halcmd show ring
Rings:
Name           Size       Type   Rdr Wrt Ref Flags
test           1024       record 0/0 0/0 0   recmax:1008

machinekit@beaglebone:~$ halcmd delring test
delring NIY: ring='test'
machinekit@beaglebone:~$ halcmd show ring
Rings:
Name           Size       Type   Rdr Wrt Ref Flags
test           1024       record 0/0 0/0 0   recmax:1008

machinekit@beaglebone:~$ halcmd newring test 1024
<commandline>:0: newring: failed to create new ring test: File exists
machinekit@beaglebone:~$
ArcEye commented 6 years ago

Comment by cdsteinkuehler Fri Oct 14 00:14:53 2016


It looks like "NIY" means Not Implemented Yet. I guess this is a feature request and not a bug...here's the code:

int do_delring_cmd(char *ring)
{
    halcmd_output("delring NIY: ring='%s'\n", ring);
    // return halpr_group_delete(group);
    return 0;
}
ArcEye commented 6 years ago

Comment by mhaberler Fri Oct 14 08:30:04 2016


A ringbuffer is a toplevel HAL object (=independent of any other) and there is no dependency tracking of which comps reference a ringbuffer - deleting a ringbuffer which happens to be referenced by a comp will likely lead to a crash

so it is best to consider a ringbuffer "eternal" (for HAL session lifetime)

the delring command is implemented in the last version I worked on 13 months ago but I do not recommend it except after all comps are unloaded

ArcEye commented 6 years ago

Comment by luminize Thu May 18 15:40:29 2017


@cdsteinkuehler do you want to keep this issue open?